More fun with git-svn

As mentioned here frequently, I have been using git-svn and a public repository on Github for Blender development. That Github repository has a couple limitations though: the history only goes back to January 2011 (which was when I first created the git-svn clone), and the commit author information is incorrect. The latter problem is due to the difference between the way SVN and Git store author data; in SVN it’s a plain username (e.g. “nicholasbishop” is my Blender committer username.) Git on the other hand typically uses a full name and email address. By default git-svn imports the username and makes up the email address (here’s an example from JesterKing’s repository¬†on Gitorious.)

Fortunately, git-svn does provide a way to map from svn committers to git committers in the form of an authors file. Probably you could use clever git commands to edit the existing Gitorious clone and fix commit author data, but since I am lazy I just re-cloned Blender’s trunk last night with my own authors mapping file.

I renamed my github “blender-bishop” repository to just “blender” since this is now a proper clone. To download it, run “git [email protected]:nicholasbishop/blender.git”.

After cloning it, you can let git-svn take over with a few commands. (These are adapted from these excellent git notes on the Blender wiki.)

git svn init
git config svn-remote.svn.fetch :refs/remotes/origin/trunk
git config svn.authorsfile /path/to/authorsfile
git svn rebase

After running those commands, you can still pull updates from the Github repository:

git pull --rebase
git svn rebase

I’ve only just finished making these changes, so there may yet be some bugs to work out. I also haven’t set up any automatic updating of the Github repository, so it will probably lag behind SVN trunk sometimes (although as noted above, you can update your local copy regardless.)

Update: Automatic updates are now enabled, but nothing has been committed to trunk tonight, so not verified that updates are working yet.

One thought on “More fun with git-svn”

Leave a Reply

Your email address will not be published. Required fields are marked *