Building simplicidade.org: notes, projects, and occasional rants

Raising your head, once a year

Once a year, I look around and re-evaluate my SCM decisions.

In the last year, I've been using darcs as my main SCM and I love it: simple and powerful. And given that I don't branch and merge a lot, I don't run into his issues.

Yet, for fairly big projects with lots of files, it starts getting a bit on the slow side. Also, I haven't find any graphical change-set browser yet. I can have one for SVN and git but not for darcs (not a web frontend, a graphical desktop application).

Also, the projects I work on are all using SVN, and I don't like to move from one to the other.

So my requirements now include the following:

  • offline operation;
  • real branching and merge (basically this requires change-set history);
  • darcs-style interactive commit;
  • supported on Mac OX X and Linux;
  • SVN gateway.

The last bullet point is new this year.

So I went looking for something that matches all of this and I found the set of git, cogito and git-svn. They seem to fit the bill perfectly.

Right now, I've compiled git from source. Its as simple as:

curl -O http://kernel.org/pub/software/scm/git/git-1.5.1.tar.gz
tar zxf git-1.5.1.tar.gz
cd git-1.5.1/
make configure && configure --prefix=/usr/local
make all
sudo make install

You should now have all the git goodness installed in /usr/local/bin. If you type git at a Terminal and you get an error like -bash: git: command not found, it's probably not in your path, so:

echo 'export PATH=$PATH:/usr/local/bin' >> ~/.bashrc

A freshly open Terminal should find it now.

After git, you should install cogito. The first is the core SCM, a meta-SCM, a set of tools to create a SCM. The second is a porcelain layer, a more user friendly user interface to git. You can download and install it with:

curl -O http://kernel.org/pub/software/scm/cogito/cogito-0.18.1.tar.gz
tar zxf cogito-0.18.1.tar.gz
cd cogito-0.18.1/
make
sudo make prefix=/usr/local install

That's it. The README of cogito is actually quite good to get you up to speed, and I would recommend reading it as the next step.

With this environment you already have everything you need to start working. To test it out, you can download the cogito git repository with:

cg-clone http://www.kernel.org/pub/scm/cogito/cogito.git ~/cogito

To see the history of change-sets graphically, you can:

cd ~/cogito
gitk --all

If the fonts and layout seems butt-ugly and unreadable, check out the alternative configuration file for gitk.

For now, I'm just testing this setup. I'm pretty happy with it. I will have to try git-svn and the cool-looking git-hunk-commit script (to have something like darcs interactive record) before I decide to switch, but it is looking very likely.

A good thing about modern SCM systems: you can switch from one to the other in a relatively simple way...