Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SVN to Git migration - undefined author, but it is

Tags:

git

svn

git-svn

Similar questions have been asked before (like this one), but the answers have not fixed it for me. My authors file looks like this:

cmannett85 = cmannett85 <cmannett85@###>
cbamber85 = cmannett85 <cmannett85@###>
www-data = cmannett85 <cmannett85@###>

And the error I get is;

Author: cmannett85 not defined in users.txt file

This error happens at about the 1500th commit, with the other author entries being fine so the basic structure of the entries must be correct. Most of the issues I've already seen on SO centre around SVN usernames having a space pre/appended to them, but as you can see from the pasted error - there is no extraneous white space.

I also thought it might have been that I'm mapping one username for an identical one, so I changed the Git username but it made no difference. I even tried switching line ending between Windows and Unix formats, but again no change.

I invoke the operation using this:

$ git svn clone https://subversion.assembla.com/svn/#### --authors-file=users.txt --no-metadata -s ####

I tried removing the --no-metadata arg, but no difference. Can anyone see where I have gone wrong?

UPDATE

Following Lazy Badger's advice, I ran:

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

And it returns this:

<author>cbamber85</author>
<author>cmannett85</author>
<author>www-data</author>
like image 322
cmannett85 Avatar asked Oct 31 '12 10:10

cmannett85


1 Answers

Just stumbled on this question and ended up solving the issue by stripping the byte-order mark from the authors.txt file encoded in UTF-8 file, thus making Linux see it as a plaintext ASCII file instead of UTF-8.

Since my file started life on Windows as Powershell output, the more general correct answer is that simple text is never simple text, which makes Lazy Badger's answer the best, as it avoids the headache of papering over these differences.

like image 82
user4388759 Avatar answered Sep 30 '22 17:09

user4388759