Springe zum Hauptinhalt

Preferring git over mercurial

Being a Py­thon pro­gram­mer, my fa­vo­ri­te dis­tri­bu­ted ver­si­on con­trol sys­tem (DV­CS) was Mer­cu­ri­al (h­g) -- was un­til a few days ago. Here are some re­a­sons why I now pre­fer git.

Mer­cu­ri­al was my fa­vo­ri­te sin­ce it is writ­ten in Py­thon, which is my pre­fer­red pro­gram­ming lan­gua­ge (mo­re pre­ci­se: the on­ly Pro­gram­ming lan­gua­ge I use un­so­li­ci­te­d).

Un­til now, I had bad ex­pe­ri­ences with git: I'm ur­ged to use git on other pro­jects and I of­ten stum­ble over things that do not work as I ex­pect or are de­s­cri­bed in a way I do not un­der­stand or is much to com­pli­ca­te­d. Whe­ne­ver I try to learn how to se­lect re­vi­si­ons from `man git­re­vi­si­ons` I get ener­va­te­d.

As you may know, I'm in­vol­ved in the de­ve­lop­ment of Py­In­stal­ler whe­re we are current­ly mi­gra­ting from Sub­ver­si­on to git. The pro­jec­t­'s foun­der, Gio­van­ni Ba­jo, ma­de me loo­king de­e­per in­to git. I'm still figh­ting with some of it­'s rough ed­ge­s, but I'm re­al­ly im­pres­se­d: It has much mo­re po­w­er­-­fea­tu­res than mer­cu­ri­al has.

gitk

At the be­gin­ning  was miss­ing `hg ser­ve`. But then I dis­co­ver­ed `git­k` -- a GUI front­-­end for his­to­ry brow­sing. Mean­whi­le I'm used to it and pre­fer it over the we­b­-­ba­sed `hg ser­ve`. One can sea­rch mes­sa­ge­s, au­t­hor­s, com­mi­ter­s, fo­cus on one or se­ver­al bran­ches, ea­si­ly jump to tags, di­rect­ly dis­play the chan­ges in se­ver­al diff­-­for­mats, and a lot mo­re. And all com­mits are on a sin­gle pa­ge, no need to brow­se through pa­ge over pa­ge­s.

git gui

The next kil­ler app is `git gui`, a tool for pre­pa­ring your com­mits.

I of­ten find my­self com­mit­ting to lar­ge chan­ge­s, sin­ce I did se­ver­al smal­ler chan­ges un­til I mind to com­mit. With `git gui` the­se is sol­ved ele­gant­ly: One can se­lect which part of the cur­rent chan­ges are to be used in the com­mit, even in­clu­de or ex­clu­de sin­gle li­nes. At the ve­ry mo­ment, I'm split­ting my ha­cked ver­si­on of re­pos­ur­ge­on in­to small com­mits so so­me­bo­dy el­se can re­pro­du­ce what I'­ve do­ne. You can see the re­sult at htt­ps://­github.­com/ht­go­ebel/r­e­pos­ur­ge­on: All com­mits un­til to­day mid­day ha­ve be­en cre­a­ted this way.

And an­o­ther plus: Com­mit mes­sage en­te­red wi­thin `git gui` are spell­-­che­cke­d. The lan­gua­ge can be se­lec­ted eit­her glo­bal­ly or per pro­jec­t.

Summary

So for new pro­jects, or when mi­gra­ting my exis­ting pro­jects to DV­CS, I'll choo­se git. It has the far su­pe­ri­or tool­s.

Portrait von Hartmut Goebel

Hartmut Goebel

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

Haben Sie noch Fragen?
Anruf oder Mail genügt:
  +49 871 6606-318
  +49 175 29 78 072
  h.goebel@goebel-consult.de