transforming the 5-branch-types !git model to the 2-branch !hg model with the same functionality

Arne Babenhauserheide arne_bab at web.de
Sat Jan 19 23:39:00 UTC 2013


Hi,

I wrote some additional information to my branching model article 
( http://draketo.de/light/english/mercurial/complete-branching-strategy 
  http://draketo.de/node/513#fn:git-to-hg )
and I thought it could be interesting to you:

If you look at the Git branching model (http://nvie.com/posts/a-successful-git-branching-model/) which inspired this Mercurial branching model, you’ll note that its diagram (http://nvie.com/img/2009/12/Screen-shot-2009-12-24-at-11.32.03.png) is a lot more complex than the diagram of this Mercurial version (http://draketo.de/files/hgbranchingoverview_2.png). 

The reason for that is the more expressive history model of Mercurial. In short: The git version has 5 types of branches: feature, develop, release, hotfix and master (for tagging). With Mercurial you can reduce them to 3: default, stable and feature branches: 

* Tags are simple in-history objets, so we need no special branch for them: a tag signifies a release (down to 4 branch-types - and no more duplication of information, since in the git-model a release is shown by a tag *and* a merge to master). 

* Hotfixes are simple commits on stable, so we also need no branch for them (down to 3 branch-types). 

* And if we only maintain one release at a time, we only need one branch for them: stable (down from branch-type to single branch). 

* And feature branches are not required for clean separation since mercurial can easily cope with multiple heads in a branch, so developers only have to worry about them if they want to use them (down to 2 mandatory branches). 

* And since the default branch is the branch to which you update automatically when you clone a repository, *new developers don’t have to worry about branches at all*. 

So we get down from 5 mandatory branches (2 of them are categories containing multiple branches) to 2 simple branches without losing functionality. And new developers only need to know two things about our branching model to contribute: 

    “If you use feature branches, don’t call them `default` or `stable`. And don’t touch `stable`”.

Best wishes,
Arne
-- 
Ein Mann wird auf der Straße mit einem Messer bedroht. 
Zwei Polizisten sind sofort da und halten ein Transparent davor. 

	"Illegale Szene. Niemand darf das sehen."

Der Mann wird ausgeraubt, erstochen und verblutet, 
denn die Polizisten haben beide Hände voll zu tun. 

Willkommen in Deutschland. Zensur ist schön. 
      ( http://draketo.de/stichwort/zensur )

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 316 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.mercurial-scm.org/pipermail/mercurial/attachments/20130120/69d81a42/attachment.asc>


More information about the Mercurial mailing list