git svn 的作者文件的格式是什么,特别是对于反斜杠或下划线等特殊字符?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/2159567/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-10 07:45:38  来源:igfitidea点击:

What is the format of an authors file for git svn, specifically for special characters like backslash or underscore?

gitgit-svncodeplex

提问by jasonpenny

I am trying to clone Papercut, an smtp server emulator

我正在尝试克隆Papercut,一个 smtp 服务器模拟器

I'm getting the list of SVN authors with svn log -q https://papercut.svn.codeplex.com/svn | grep -e '^r'| awk 'BEGIN {FS="|"};{print $2}'|sort|uniqwhich is giving me

我得到了svn log -q https://papercut.svn.codeplex.com/svn | grep -e '^r'| awk 'BEGIN {FS="|"};{print $2}'|sort|uniq给我的 SVN 作者列表

RNO\_MCLWEB
SND\krobertson_cp

I created an authors.txt with the SVN_User = UserName <Email>format, but when I run

我用这种SVN_User = UserName <Email>格式创建了一个authors.txt ,但是当我运行时

git svn clone --no-metadata -A authors.txt https://papercut.svn.codeplex.com/svn papercut

it complains "Author: RNO\_MCLWEB not defined in authors.txt file"

它抱怨“作者:RNO\_MCLWEB 未在authors.txt 文件中定义”

I've tried with putting a \ before the '\' and '_' to try to escape them, and adding quotes around the name, but neither worked.

我试过在 '\' 和 '_' 之前放一个 \ 来尝试对它们进行转义,并在名称周围添加引号,但都没有奏效。

I can't find any better description of the authors.txt file format than SVN_User = UserName <Email>

我找不到比authors.txt 文件格式更好的描述 SVN_User = UserName <Email>

回答by mipadi

I hate to be "that guy", but I just gave it a try and it worked fine for me. Here's the copy of the authors file I used:

我讨厌成为“那个人”,但我只是尝试了一下,对我来说效果很好。这是我使用的作者文件的副本:

RNO\_MCLWEB = Ronald McDonald <[email protected]>
SND\krobertson_cp = Some Guy <[email protected]>

I did, however, use a slightly different method than you did to generate author names, following these directions. My specific incantation was:

但是,我确实按照这些指示使用了与您生成作者姓名的方法略有不同的方法。我的具体咒语是:

$ svn log --xml | grep author | sort -u | perl -pe 's/.>(.?)<./ = /'

I'm also using Git 1.6.6.1 (doubt that makes a difference, but you never know).

我也在使用 Git 1.6.6.1(怀疑这有什么不同,但你永远不知道)。

I did notice that when I used your pipeline to get the SVN authors, there were spaces in front of their SVN usernames in the resulting file (i.e., there was a space in column 1 on each line). Don't know if that makes a difference or not.

我确实注意到,当我使用您的管道获取 SVN 作者时,结果文件中他们的 SVN 用户名前面有空格(即,每行的第 1 列中有一个空格)。不知道这有没有区别。

回答by Zeke Fast

I had same problem, but with user apache. In authors file a had line like this.

我有同样的问题,但用户 apache。在作者文件中有这样一行。

apache = Apache

or

或者

apache = Apache <>

But when I set it to

但是当我将它设置为

apache = Apache <[email protected]>

My repo started cloned normaly. Please be sure that you set all you authors names and email correctly, with follow format

我的回购开始正常克隆。请确保正确设置所有作者姓名和电子邮件,格式如下

svn_user_name = JustNameInGit <[email protected]>

Every field is obligatory!!!

每个字段都是必填项!!!

回答by Justin Ohms

I used the following which helps skip messages with words like 'authorization' in them

我使用了以下有助于跳过其中包含“授权”等词的消息

svn log --xml | grep /author | sort -u | perl -pe 's/.>(.?)<./ = /' > users.txt

回答by mct2386

I had this issue, it turned out to be the file encoding in my example. Make sure the text file is saved at UTF-8

我遇到了这个问题,结果是我的示例中的文件编码。确保文本文件以 UTF-8 格式保存

You can do this in any good text edit (eg notepad++ Encoding menu)

您可以在任何好的文本编辑中执行此操作(例如记事本++编码菜单)