Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Author not defined when importing SVN repository into Git

Tags:

git

git-svn

I'm trying to import our SVN repository into Git. When I run either this command:

git svn --authors-file=/path/to/authors --trunk=trunk clone https://my-repo/project . 

or this command:

svn2git https://my-repo/project --no-minimize-url -v --authors /path/to/authors 

Both return this error:

Author: patrick  not defined in /path/to/authors file 

..but as far as I can tell, there is nothing wrong with my authors file:

$ grep patrick /path/to/authors patrick = Patrick <[email protected]> 

That error doesn't happen until it gets to revision 8700, so it must be grabbing the other author names correctly.

What could be going on here? Thanks.

like image 589
Greg Avatar asked Jun 14 '12 16:06

Greg


2 Answers

I've had the same issue when trying to execute this on Windows. It turned out that the encoding of the file that I stored the authors in was set to UTF-8 instead of UTF-8 without BOM. As the "with BOM" version adds some additional bytes to the beginning of the file, the first author in the list was never found.

like image 84
Daniel Lemke Avatar answered Oct 01 '22 02:10

Daniel Lemke


I had the same problem but the cause was actually rather different: I used Powershell to dump the authors list from SVN and I didn't realized that it saved the result as a UTF-16 file.

It turned out git (at least, up to git for windows version 2.16.1) is unable to use UTF-16 files. Converting the file to UTF-8 did the trick for me.

like image 39
Stephane Avatar answered Oct 01 '22 02:10

Stephane