4

I'm having trouble cloning svn repository from Git. I have defined users.txt file containing all users who contributed in SVN repo. Then I execute the following command to clone SVN repo:

git svn clone --no-metadata --authors-file=C:/temp/Migration/AES_Exchange/users.txt https://some.url.com
/repos/Exchange Git_SVN

But I get an error stating: "Author: SVNAdmin not defined in C:/temp/Migration/AES_Exchange/users.txt file"

Even though that user is defined in users.txt file.

SVNAdmin = svnadmin <svnadmin@sss.com>
adaraz = adaraz <adaraz@sss.com>

Any help would be greatly appreciated.

Thanks

Davita
  • 8,928
  • 14
  • 67
  • 119

2 Answers2

8

I'm not sure what caused the issue, but changing users.txt encoding from UTF8 BOM to UTF8 fixed the issue. I used notepad++ -> Encoding -> Encode in UTF-8 -> Save. I read somewhere that because BOM comes with header, Git was unable to properly read first line in the file, and hence, misses the first user. I lost the link so can't share it, sorry for that, but anyway, looks like a lame bug.

Davita
  • 8,928
  • 14
  • 67
  • 119
  • 1
    Ah, that makes sense of course. And it is not a bug. If a file has to be in a specific encoding, it has to have it. If you save the file in a different encoding, the consumer gets wrong content because he still uses the requested encoding to decode the file. UTF-8 with BOM is a different encoding than UTF-8. BOM means byte-order-mark and is a three byte sequence that specifies whether little or big endian is used. If you decode this with "normal" UTF-8, you get those three extra bytes in front of the first line and thus in your case it did not match of course. – Vampire Apr 08 '16 at 21:40
  • 1
    I had the same issue and it was an encoding error. As soon as I saved it as UTF-8 it worked. So still an issue years after this initial question. Also if I had better read the directions on using the clone utility it said to save as UTF-8. – That Bryan Davies Nov 21 '20 at 02:59
1

Do you use Git for Windows or Cygwin Git? If the latter you might need to give the path in Cygwin syntax. If the former try using backslashes and quotes around the option or double backslashes or a combination.

Vampire
  • 35,631
  • 4
  • 76
  • 102
  • I'm not sure which deployment is this, as I have installed from https://github.com/gitextensions/gitextensions/releases/tag/v2.48.05 <-- here. However, I tried both suggestion and nothing helps. The problem is not with path I guess, as git throws a different error message when it can't find users.txt – Davita Apr 08 '16 at 18:22
  • Maybe try writing the username in all lowercase in the file? – Vampire Apr 08 '16 at 18:32
  • Hm, then I have no idea besides debugging or using `--authors-prog` – Vampire Apr 08 '16 at 18:35
  • Can you elaborate a little bit please? I don't seem to find --authors-prog parameter in the documentation. and how can this be debugged..? Thanks – Davita Apr 08 '16 at 19:23
  • I ended up using --authors-prog as it was really tiresome to update every user missing in users.txt file. Thanks for the Hint :) – Davita Apr 08 '16 at 19:52