10

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>
Community
  • 1
  • 1
cmannett85
  • 21,725
  • 8
  • 76
  • 119

4 Answers4

5

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.

Paul Richter
  • 10,908
  • 10
  • 52
  • 85
user4388759
  • 111
  • 1
  • 5
  • This does not provide an answer to the question. To critique or request clarification from an author, leave a comment below their post - you can always comment on your own posts, and once you have sufficient [reputation](http://stackoverflow.com/help/whats-reputation) you will be able to [comment on any post](http://stackoverflow.com/help/privileges/comment). – AdamMc331 Dec 23 '14 at 14:59
  • I'll ask this - I submitted my answer because not everyone can easily regenerate the original file, and it might be useful to know WHY Lazy Badger's answer works. Doesn't this qualify as enough content for a separate answer? – user4388759 Dec 23 '14 at 15:26
  • I understand where you're coming from, but when I saw this in the review queue (someone else flagged it) I think they did so because your answer could also be considered commentary, as you even suggest and recommend a different answer. If it were me, (assuming I had the rep to comment) I would have just commented on another answer or even the question about what you did that worked for you. – AdamMc331 Dec 23 '14 at 15:28
  • This is a bit of a tough call, and while I'm not familiar with the topic of the question, I think its a legitimate answer. I don't know if its possible in this circumstance, but in general if you're able to flesh out answers a little more, you can definitely avoid the "comment as answer" flags. You can also comment on other posts when you reach 50 rep points, I believe. – Paul Richter Dec 23 '14 at 16:13
3

I think I found the problem and the solution:

My author.txt was encoded as UCS2 Little Endian after converting it to ANSI the file size dropped to 50% and it worked.

The filesize dropped from 70KB to 35KB, but I don't think, that this is the solution.

My author.txt was created with a powershell-script from the Windows Active Directory.

I also changed the line-ends from CR LF to LF, but you mentioned, that you have already tried this, too. So I think it is a charackter-encoding issue.

Christian Kuetbach
  • 15,850
  • 5
  • 43
  • 79
2

I'm sure - preparing user-list from pure SVN-data before clone will be more bullet-proof way

I.e something like:

svn log --xml URL | grep "author" | sort -u | ...strip xml-tags here...
Lazy Badger
  • 94,711
  • 9
  • 78
  • 110
  • Thanks, it reassured it me I wasn't going mad, but hasn't revealed the issue. Please see my update. – cmannett85 Oct 31 '12 at 11:47
  • 1
    @cmannett85 - out of ideas... if you can detect, which revision (exactly) is problematic, I'll suggest propedit it. In case of hg I'll use partial clone and pull -r by small series (know nothing about git svn possibilities) – Lazy Badger Oct 31 '12 at 12:25
2

I've just encountered the same issue as described here and it turned out that by creating a new .txt file just in notepad++ (the original authors file was generated by a powershell command I found elsewhere) and then copying the contents of the original file into the new .txt file, the fetch then worked.

Turns out the original file was encoded as UCS-2 Little Endian (as above) but the default encoding of UTF-8 works. I didn't need to change the line endings.