Sunday, March 08, 2009

git vs mercurial

In the past we've stuck with subversion for PySoy over git because about half our team are Windows devs and git has very poor Windows support. Some of us have been using git-svn to use git locally while not making life difficult for the other half.

Last night I migrated the Concordance-XMPP project to mercurial as a trial.

First, I have to say that Mercurial's subversion migration tools need work - simple things like author lookup tables (svn username -> Full Name <email>), option to turn off auto-tagging, and a template for modifying commit messages so we can turn off marking the history up with "[rXXX]".

These things were easy enough given that Mercurial is Python-based. Two hours later I had a proper migration.

In contrast with my earlier attempts at migrating to git, mercurial was actually a joy to setup on the server. WSGI, using our existing .htusers file from Trac, a small config script, done. This contrast to git which would require some funky SSH sandboxing and/or PAM setup - yes it can be done, but such hacks shouldn't be needed.

To all our surprise "hg clone" was extremely fast even compared to subversion and especially in comparison to git. One development commented that it seemed "instant". Even for the small commit history (2 months, about 130 commits) git could take several minutes to clone and process Concordance's history.

I'm disappointed to see GPLv2-only on Mercurial as we won't be able to use it directly in any GPLv3 or AGPLv3 projects. Upward license compatability good, anti-FSF paranoia bad.

Thankfully hg's protocol is easily derived and can be implemented by other Python software without having to actually import any part of hg. Hopefully the Mercurial's license situation will be solved at some point to minimize redundant work.

4 comments:

Jesse said...

Sticking to GPL v2 only isn't FSF paranoia or FUD, some of us simply don't approve of, or like where the GPLv3 goes. Just as GPLv3 people might not like BSD/Python/MIT-style licenses.

Baczek said...

git clone and git svn clone are _completely_ different things; git clone will also be instant on such a small repository.

Arc Riley said...

This is fine, the Mercurial team can license their work however they choose. However, their choice to prevent Mercurial from being imported from GPLv3 and AGPLv3 projects creates extra work for would-be integrators.

For the moment I'm skipping further hg integration work since it'll take a week or two to write the plugins without being able to base the plugins on mercurial itself.

Matt said...

My understanding is the 'hg clone' uses hard links (which don't work on AFS) which may account for some of the speed. Additionally, I had no problem using hg convert with the --authors option, but that was from CVS, so maybe it doesn't work the same way with svn?