Springe zum Hauptinhalt Profilbild Hartmut Goebel

Hartmut Goebel

Diplom-Informatiker, CISSP, CSSLP, ISO 27001 Lead Implementer



Anfrage
Logo Goebel Consult

Preferring git over mercurial

Being a Python programmer, my favorite distributed version control system (DVCS) was Mercurial (hg) -- was until a few days ago. Here are some reasons why I now prefer git.

Being a Python programmer, my favorite distributed version control system (DVCS) was Mercurial (hg) -- was until a few days ago. Here are some reasons why I now prefer git.

Mercurial was my favorite since it is written in Python, which is my preferred programming language (more precise: the only Programming language I use unsolicited).

Until now, I had bad experiences with git: I'm urged to use git on other projects and I often stumble over things that do not work as I expect or are described in a way I do not understand or is much to complicated. Whenever I try to learn how to select revisions from `man gitrevisions` I get enervated.

As you may know, I'm involved in the development of PyInstaller where we are currently migrating from Subversion to git. The project's founder, Giovanni Bajo, made me looking deeper into git. I'm still fighting with some of it's rough edges, but I'm really impressed: It has much more power-features than mercurial has.

gitk

At the beginning  was missing `hg serve`. But then I discovered `gitk` -- a GUI front-end for history browsing. Meanwhile I'm used to it and prefer it over the web-based `hg serve`. One can search messages, authors, commiters, focus on one or several branches, easily jump to tags, directly display the changes in several diff-formats, and a lot more. And all commits are on a single page, no need to browse through page over pages.

git gui

The next killer app is `git gui`, a tool for preparing your commits.

I often find myself committing to large changes, since I did several smaller changes until I mind to commit. With `git gui` these is solved elegantly: One can select which part of the current changes are to be used in the commit, even include or exclude single lines. At the very moment, I'm splitting my hacked version of reposurgeon into small commits so somebody else can reproduce what I've done. You can see the result at https://github.com/htgoebel/reposurgeon: All commits until today midday have been created this way.

And another plus: Commit message entered within `git gui` are spell-checked. The language can be selected either globally or per project.

Summary

So for new projects, or when migrating my existing projects to DVCS, I'll choose git. It has the far superior tools.