Author not defined when importing SVN repository into Git

Greg picture Greg · Jun 14, 2012 · Viewed 13.1k times · Source

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.

Answer

Daniel Lemke picture Daniel Lemke · Feb 3, 2015

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.