Geeky things and other research from a work in progress


I git it now!

After a lot of discussion about GHC switching from darcs to git, I was tempted to try it out. Today was an experimentation day for me, and it turned out really well.

I come from the world of Subversion. It has been my primary VCS for a number of years, and that's mostly by circumstance. In my master's program, it was just easiest to get access to. At my last job, SVN was the main repository for everything. I became very familiar with it: it's quirks with moving files, it's problems with merging branches, and so on. Sure, it's not the best, but it worked well enough. In fact, my current place of employment also uses SVN extensively.

As I gradually become more familiar with the Haskell community, I encountered darcs. I never really became comfortable with it, though. It was quite slow for basic things. The large number of commands and the many ways of doing things that are similar but slightly different was, truth be told, somewhat overwhelming. Of course, I only used darcs to pull source repositories for building. I never had my own repository or tried to send a patch to someone else.

Then, this thing with GHC and its libraries came up. They were looking for maintenance of the SYB library, and we volunteered. I presume that the GHC developers are going to set up git repositories for the libraries, so I figured I should get to know git. In my reading, I had learned about several features of git that intrigued me. It was these features that lured me in and have pretty much captured me, too.

First, there's the concept of local branches. I love it! I can't get enough. I generally make copies of directories and files to do my own form of local branching. Perhaps it's naive, but it is the best solution I had found up to now. I often don't want to check unstable code or unused code into the central repository. Either it's more effort than I want to spend at the time or it ends up in a branch that is forgotten about and gets out of date quickly. The git local branches are simple: I don't have to spend time copying. They are quick: git checkout <branch>. And they stay in the same place as the master branch, so I don't have to search for them in my files. Wonderful!

Second, git has a very nice extension, git-svn, for integrating with a Subversion repository. Since we use that at work, I can try out git and using it to actually do work. That's what today's experiment was about.

As for comparing VCS tools, I can't say I'm very qualified. My general (and limited) experience with darcs is that it is very slow and difficult to figure out how to use. My experience with git is that while it has a very large number of commands, it is thoroughly documented. There are a number of tutorials available to point out what I need to get started using. Plus, there's the page on git for Subversion users.

So, I will continue to experiment with git, since I can do it without much difficulty. So far, I'm more happy than not. It's obviously not perfect, but I like the things it does best.


  1. I'd love to hear what is behind the statement on darcs: “The large number of commands and the many ways of doing things that are similar but slightly different was, truth be told, somewhat overwhelming.”

    My limited experience is that darcs has a very nice UI with clear and (mostly) obvious commands, while git has a much richer set of confusing commands. Git commands relate to each other in non-obvious ways (they have to be used in a specific order), they are too low-level (often a couple of commands have to be used to achieve what in other VCSs is a single command), there are seemingly several ways to achieve the same thing by using different commands.

  2. And you'll be disappointed, because I don't have a very good answer for you.

    Yes, they both have a large command set. That's definitely not one of the reasons I like git.

    I don't know about the low-level aspect, yet, or the non-obvious ways. I admit many things were non-obvious to me with both darcs and git coming from Subversion.

    Basically, I am happy using git for exactly the reasons that I wrote. Currently, I use it as a better svn. So, in all honesty, I shouldn't have even attempted a comparison of darcs.