tags:

views:

207

answers:

1

I'm tracking a svn repository using git-svn and have an authorsfile to get real names for the committers. svn doesn't seem to care about the casing of usernames -- there are commits with username variations like username, Username and UserName which definitely belong to the same committer. Unfortunately git-svn respects casing, so I have to add all variations to my authorsfile. As that file is automatically generated this is a bit problematic -- it's not much of a problem with NameSurname user names but fails for SomeNickname.

Is there a way to make git-svn ignore the username casing when using the authorsfile?

+1  A: 

Well, git-svn actually runs a perl program so you can edit that if you dare:

/usr/lib/git-core/git-svn on debian linux

There only seem to be a few lines of code that are related to looking up the users database:

around line 1217:

            next unless /^(.+?|\(no author\))\s*=\s*(.+?)\s*<(.+)>\s*$/;
            my ($user, $name, $email) = ($1, $2, $3);

change the second line to lowercase $user with 'lc' like this:

            next unless /^(.+?|\(no author\))\s*=\s*(.+?)\s*<(.+)>\s*$/;
            my ($user, $name, $email) = (lc $1, $2, $3);

and put in the authors file just the lowercase ID to email mapping like:

foo = Mr Foo <user@host>
bar = Ms Bar <otheruser@host>

I've not tested this!

dajobe
This unfortunately didn't work as expected. I solved the issue with a different approach -- as the authorsfile is converted from a different mapping file anyway I now check the svn logs, filter out all usernames using mixed-case and adding additional translations for them when converting the file.
bluebrother