I recently stumbled across the essay In brief praise of DVCSs by Aristotle Pagaltzis, and it was a revelation for me. I’d been wanting to try a DVCS for a while, but hadn’t really gotten around to it — the perceived benefit hadn’t justified the perceived effort. But when Aristotle pointed out that Subversion makes the mental overhead of creating a repository very much greater than any DVCS, something clicked. I saw an immediate benefit I’d gain from even simplistic usage of a DVCS, and so I immediately gave it a try.

I had a text file that I wanted to explicitly track versions of — I use Time Machine for incremental backup, which is great, but doesn’t always give me precise enough control of the snapshots, and I don’t always have the snapshots available. Once I read Aristotle’s essay, it only took me a few minutes to download and install Mercurial, and then I started tracking my file with three simple commands: hg init; hg add *; hg commit -m "initial". Quick, easy, and effective. From that point on, my folder was also a repository, and I could track specific revisions of my files by simply typing hg commit -m "update" at any point.

What I think is the killer realization here is that it is now super easy to make any folder into a repository, and instantly start tracking versions of its contents. I’ve used Subversion to make local repositories, and track local files in the past — and it really is many more steps, and much more work. It’s also messier, because the repository and the working copy must be separate entities — you have to think about where the repository should live, as opposed to the actual stuff, the working copy. With a DVSC, no such dichotomy exists. The repository and the actual stuff are one and the same. You can move them, zip them, email them — as long as the metadata directory is preserved (for example, .hg or .git), the folder remains a repository.

I’m thankful to Aristotle for helping me get past the initial barrier to entry, and start actually using a DVCS. I’m looking forward to learning more about them, and using them even more going forward.

(Bonus tip: on OS X, some applications save their data using a special type of file called a “package”, which is actually a directory with a special flag. One example is OmniGraffle, which I use frequently. Because these “files” are actually directories, they can be easily made into self-versioning files with their own self-contained repositories. Just navigate to the directory and run the commands above! From that point on, the file will be a repository and can track its own versions. Pretty useful!)

(I can’t explain exactly why I decided to try Mercurial first, before Git or Bazaar. I’ve read many comparisons of them, and something about those comparisons just made me want to try it. I’m not sure exactly how, but I had built up the impression that Mercurial was somehow simpler, cleaner, more elegant, and more approachable than Git or Bazaar. I don’t know if that’s actually true, but the impression was enough that that’s where I started.)

(Aristotle’s mention of “mental overhead” as a decisive factor in using one system over another is something I’ve been thinking about lately as well, although I’ve used the more unwieldy “cognitive overhead.”)