Home

apparently I'm a dinosaur

Recent Entries

the dinosaur

floating

View

September 2nd, 2007

The Best Laid Plans

Add to Memories Tell a Friend
floating
Hooray! A long weekend to catch up with all Debian work I've been neglecting!

Hooray! A long weekend to play Metroid 3 on the Wii!

Actually I have made some useful progress, converting nearly all of my packages over to git, even starting an Alioth project for the OpenSC suite of packages. Help is welcome! I should also pump out some updated packages where need be, and I should try to give Iceweasel some love, as it needs it badly.

July 15th, 2007

git'ing it on

Add to Memories Tell a Friend
floating
A hot topic this past DebConf7 was git. I've bought into the hype, so I decided to take the plunge and move my Subversion repositories to it. A lot of people seem to be willing to part with their history when making the move, but I'm some what irrationally attached to it.

Most of my Debian packages are in one big SVN repo, which used to be one big CVS repo (I used cvs2svn to move). So I decided to pull apart each source package into its own git repository. I started with git svn clone like so:

$ git svn clone -A authors --trunk=trunk/libclass-makemethods-perl \
  --branches=branches/libclass-makemethods-perl/upstream \
  --tags=tags/libclass-makemethods-perl --no-metadata \
  file:///home/svn/debian libclass-makemethods-perl


And this gives a git repo that can track an SVN repo. But I want to go all the way, no turning back. So I made a little script to clean up this repo called clean-git-svn:

#!/bin/sh -e

tags=`git branch -r | egrep 'tags/[^@]+$'`

echo "$tags" | perl -ne \
  'chomp($_); my $head = $_; s,\s+tags,debian,g; print "git tag $_ $head^\n"'
for i in $tags ; do echo "git branch -r -d $i"; done

upstream_tags=`git branch -r | egrep ' +[0-9][^@]+$'`

echo "$upstream_tags" | perl -ne \
  'chomp($_); s,\s+,,g; print "git tag upstream/$_ $_^\n"'
for i in $upstream_tags ; do echo "git branch -r -d $i"; done

echo "git branch upstream current"
echo "git branch -r -d current"
echo "git branch -r -d trunk"


This will output a bunch of git commands that will make this a more "gitified" repo. I make no guarantees this will work, you should probably hand check your history with gitk to make sure this won't screw anything up. If your the part you're converting also came up from CVS, you'll probably have a bit of a mess on your hands that will need more manual cleanup. gitk is really an amazing visualization tool and can help a lot here. Once you're satisfied just pipe it into /bin/sh. Since git svn mostly can't track where you merged in your SVN repo, make sure you merge the upstream branch into master as soon as you can. It will save you a lot of conflicts later, trust me.

One thing I miss from svn is svn export. Does an equivalent command exist in git? You would think there would be an option you could pass to git clone to do this but I can't seem to find anything.

May 29th, 2007

Two blog posts in one day!

Distributed revision control systems are all the rage these days and I think the time has come to adopt one. I've always thought they were a good idea, but Subversion worked well and suited my needs well enough. I was also somewhat put off by the number of choices and didn't want to switch to something that would turn out to be a dud. But now there seem to be two main contenders, Git and Mecurial. I think Linus' recent talk on git also helped rekindle my interest.

Despite Linus' protestations of greatness, I was thinking of using Mercurial since it seems to fit better with my Subversion centric view of the world and it appears that Mozilla is going to move to it from CVS. I already have a few CVS and Subversion repositories for various things and I would like to keep that history. So I fired up Tailor and started converting a mail archive I have in an svn repo. The repo is only 1.5G, but Tailor was slow. Surprisingly slow. It then failed right near the end of the conversion. I'm also not sure exactly how much history Tailor is preserving. Does it deal with things like file moves properly?

Disheartened, I took a look at git instead. It seemed to have a tool called git-svnimport that sounded very promising. I ran it against the same svn repo and it proceeded to consume all the memory on my system and cause it to thrash like mad. My machine became so unresponsive that I had to log in remotely to kill the import.

So in the end, dear lazyweb, what tools should one use to convert a Subversion repository to Mercurial and/or Git?
Powered by LiveJournal.com