1

I'm attempting to convert an SVN repository to Git, mostly trying to piece together the process from these two blogs:

John Albin Wilkins

Eelke Blok

and this StackOverflow post:

cmcginty

I created a file to map SVN users to Git users (Wilkins calls it authors-transform.txt, while Blok and 'cmcginty' call it users.txt), even though I don't understand its purpose or how it's supposed to look. I used Wilkins's script,

svn log -q | awk -F '|' '/^r/ {sub("^ ", "", $2); sub(" $", "", $2); print $2" = "$2" "}' | sort -u > authors-transform.txt

To the best of my understanding, I've successfully completed the procedure up to the point of running $ git svn fetch. When I attempt that, the process ends with the error

$ git svn fetch
...
Author: jimi@JH.EXPERIENCE.ORG not defined in authors-transform.txt file

It isn't clear from the output that this is a breaking error in the process, but Blok identifies it as such. At this point, I'm supposed to "fix" the authors-transform.txt file, but I have no clue how. This author is in the file:

jimi@JH.EXPERIENCE.ORG = jimi@JH.EXPERIENCE.ORG

There are no further lines I can add to authors-transform.txt that will cause this user to be more included in the file that he already is.

The only additional StackOverflow questions I can find that's relevant to this topic are this one and this one. They mention spaces at the end of names, which I've fixed in authors-transform.txt, and the file encoding of authors-transform.txt. It's hard to imagine that encoding is an issue, since I'm not on Windows or using any other software that would interfere with encoding (I'm using Ubuntu 20.04), but in any case there are no actionable suggestions regarding encoding on those pages.

What am I supposed to do to make this process proceed?

Borea Deitz
  • 379
  • 4
  • 11

2 Answers2

0

Try specifying path to the authors file in the commandline options:

git svn fetch --authors-file='/path/to/authors-transform.txt'
beatcracker
  • 6,714
  • 1
  • 18
  • 41
0

Evidently, git svn requires that the lines of the authors file adhere to a specific format, which wasn't clear from the documentation I'd been reading. This SO answer explains it well. The format is

user1 = First Last Name <email@address.com>
user2 = First Last Name <email@address.com>
...

where the names on the left hand side are SVN users, and the right hand side is the name and Git-registered email of the Git users. Note that the email address must be enclosed in angled brackets <>.

My confusion was compounded by the fact that I was following Wilkins's blog post most closely, and either my browser or his web publishing technology was treating the angled brackets <> as markup so that they and their contents were not rendered on my page, leaving

user1 = First Last Name
user2 = First Last Name
...

Thus, none of the authors in my authors file were properly defined, and git svn stopped and complained about only the first SVN user it encountered, which was jimi@JH.EXPERIENCE.ORG.

After correcting each line of the authors file to use the correct format (with emails in angled brackets), the $ git svn fetch command worked as advertised.

Borea Deitz
  • 379
  • 4
  • 11