home of the madduck/ blog/
Tracking svn-buildpackage-style packages with Git

Previously, I wrote about how to convert SVN-tracked packages to Git. Unfortunately, not all packages can be converted just like that. For instance, we've only recently imported python-docutils into the Subversion repository of the Debian Python packaging team, and I am not going to push Git on those people.

But there's git-svn, so I don't have to. In addition to being an excellent conversion tool, git-svn also allows you to track and interact with a Subversion repository.

The challenge in this case is that the python-docutils repository only tracks the debian/ directory, not the upstream code. This approach relies on svn-buildpackage to combine the upstream source with the checked out code to build, which works. However, it makes it unnecessarily cumbersome to work on e.g. Debian-specific changes to the upstream code.

Let's see what we can do to improve the situation without influencing the whole team.

git-svn init --prefix=debian/ --stdlayout svn+ssh://svn.debian.org/svn/python-modules/packages/python-docutils python-docutils

git-svn init -R upstream --prefix=upstream/ -T trunk/docutils svn://svn.berlios.de/docutils python-docutils

git config svn-remote.upstream.tags 'tags/*/docutils:refs/remotes/upstream/tags/*'
git config svn-remote.upstream.branch 'branches/*/docutils:refs/remotes/upstream/*'

git-svn init -T trunk/docutils -t 'tags/*/docutils' -b 'branches/*/docutils' svn://svn.berlios.de/docutils .

git-svn fetch --all

NP: Queen: Queen II