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

4

19

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>

Stella answered 29/1, 2010 at 2:43 Comment(1)
Type git svn clone -help and look for the -A option for a good description about the authors.txt file.Tristis
F
28

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

Frontolysis answered 29/1, 2010 at 3:11 Comment(2)
The first time I made the authors.txt, I didn't put a string like [email protected] for the email, just <MCLWEB> I guess that was the problem, since an authors.txt with the text you showed did clone without a problem (git 1.6.5.1). I thought I had tried with proper email addresses, but apparently not. Anyway, thanks.Stella
Regex is incorrect - it needs to match more than 1 char. Fixed: 's/.*>(.*?)<.*/$1 = /'Person
I
17

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 <[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!!!

Invent answered 24/1, 2012 at 18:36 Comment(2)
See this question for a similar discussion.Dib
Noting that every field is obligatory helped me. The link from eykanal implies that it isn't which seems to be true in the case he linked, not during an SVN import.Declension
S
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
Strange answered 7/5, 2013 at 20:26 Comment(0)
B
3

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)

Bituminous answered 11/9, 2019 at 15:58 Comment(1)
This solved it for me as well. The file was originally generated by the atlassian svn migration script from within powershell on windows 10, and it was UTF-16. I saved as UTF-8 and it worked.Silveira

© 2022 - 2024 — McMap. All rights reserved.