Looking at darcs

I’ve been coming to realise that I’m not really as satisfied with arch as I’d like to be; in spite of being an ardent fanboy for a while now. My main requirement for software is that it be simple and stay out of my way; and while arch is fairly simple, it’s evidently proven not simple enough for me to actually use it regularly. A brief chat with Greg Black on the topic at HUMBUG over the weekend finally made me decide to look into this again; so inspired by Martin’s occassional raves, I decided to have a poke at darcs.

darcs is yet another reinvention of revision control. It’s key change is that it doesn’t bother with a repository per se at all — instead it’s a tool to manage a revision history for a single source tree. It doesn’t even do version numbering for you, let alone branching. What it does do is let you manipulate your history in the form of individual patches, and in particular lets you copy patches from one directory to another. Impressively, this turns out to be all you need.

The cool thing about this is it makes for really lightweight version control — since there’s no external repository at all, you don’t have to worry about any setup or how you might affect anyone or anything else. You can just get a source tree (from darcs, from a tarball, or from CVS), run darcs init; darcs add -r . and start working. If you decide you were wasting your time, you can just rm -rf the directory, and there’s nothing else to worry about cleaning up. That’s pretty sweet. And since it ignores the issue of versions and branches, you can set them up to work however you like — branches are just a matter of making a new directory somewhere on the filesystem, and version numbers are just a string you use when tagging a version.

There’s a few downsides too, of course. Obviously there’s no pre-made “repository” that’ll store all your branches and handle permissions and keep them safe from an accidental rm -rf for you. If you want a version control system to stop your developers from screwing up and losing stuff, that’s a big loss. Making a repository out of a bunch of darcs working directories is possible, but not terribly space efficient, and you have to control access to it yourself (though using ssh and sudo is directly supported). darcs isn’t terribly fast, either, if you’re dealing with lots of changesets, aiui. Also annoying is that darcs doesn’t cope with preserving file metadata, as far as I can see — so timestamps, permissions and ownerships aren’t in the revision control, though they are kind-of preserved. On the other hand, the only annoying filenaming is the _darcs directory where all the darcs information goes — and it’s only one directory per project/branch which is less annoying than CVS dirs everywhere, and an underscore’s nowhere near as obnoxious as curly braces and leading plusses. I’m presuming it’s an underscore instead of a dot for better Windows compatability.