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

醉酒当歌 提交于 2019-11-30 12:05:25

问题


I am trying to clone Papercut, an smtp server emulator

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|uniq which is giving me

RNO\_MCLWEB
SND\krobertson_cp

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

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"

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>


回答1:


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 <dude@example.com>
SND\krobertson_cp = Some Guy <someone@example.com>

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/.>(.?)<./$1 = /'

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

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.




回答2:


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

apache = Apache

or

apache = Apache <>

But when I set it to

apache = Apache <noreply@something.com>

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 <obligatory@email.com>

Every field is obligatory!!!




回答3:


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

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



回答4:


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

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



来源:https://stackoverflow.com/questions/2159567/what-is-the-format-of-an-authors-file-for-git-svn-specifically-for-special-char

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!