Once again about Mercurial vs Git (with pictures)

Original author: JH Woodyatt
  • Transfer
Some time ago, I published a very verbose essay, where I tried to explain why Git is seriously broken, and why everyone should use Mercurial instead, until the Git developers fix it. Well, I was not so rude, but close to that.

The people at Reddit complained that my technical language was too confusing, especially because I came up with new terminology in trying to prove my point. They demanded graphs, with nodes, edges, circles, arrows, and everything else. Then I tormented the graphical editor for several hours and got two graphs, given below, with which I hope to outline the problem.

Below I drew a simplified history graph for the Git repository with three branches created: "master", "release" and "topic". Before the Git enthusiasts start swearing that I have managed to show an unrealistically bad case of the complexity of history, let me assure you that this is actually a simplified example. I have access to the real Git repository, where six working release branches, about forty working theme branches, and several hundred previously existing branches that have already been removed from the central server are created.

Here is this graph. Can you tell me on which branch was recorded change ab3e2afd? What was the earliest change on the release branch? Where exactly did the topic thread begin?
Git

I know this is unfair. I do not show you the change log. But believe me, you will not want to see him. He will not help. You think that domesticated primates [1] wrote down useful hints there that would answer these questions, but they did not. Even worse, sometimes they lie.

A more intelligent refutation of my questions would be to ask, “Why do you need to know this?” Let me answer this one by one.
  1. I need to know on which branch it was fixed ab3e2afdin order to know whether to include it in the description of changes in a future release.
  2. I need to know what change was the first in the release branch, because I want to start a new thematic branch with this change as a starting point so that I am always aware of what is happening in the main branch as much as possible, and be sure that I can Perform a clean merge to the main branch and release.
  3. I need to know where the topic topic started so that I can put all the patches together and send them to my colleagues for review.
Most of the insanity that pushes Git users to a heated debate about rebase versus merge is because they really want to force developers to significantly redo the history in their local repositories so that the change graph does not look on public servers would be like the graph shown above.

Mercurial users, in most cases, do not need such unnatural coercion. And here's why:
Mercurial

See the difference?

Each node in the graph is colored to show the name of its branch in Mercurial. Any guessing game becomes unnecessary. You firmly know that once there was a branch with the name “temp”, which then merged into the branch “release”, and not “master”. Probably, now it is marked closed, as it is no longer needed.

Some initial work on the topic branch went into the temp branch before merging with the release branch. Later, the release branch was merged back into the newly launched topic topic.

All this becomes possible because Mercurial stores the branch name in the header of each change. Git should do it too, but it doesn't. Instead, Git encourages users to fake the story as if it were “clean,” but actually unsightly.

The saddest thing is that most Git users seem to have a conceptual block against even admitting that there is a problem. They accept the need for such historical revisionism, which their tool imposes on them, and call it dignity.

I am scared by the prospect of the possibility of transferring the source code of some large and venerable proprietary operating system from the old inherited version control system to the new cool distributed system that all the guys talk about. I am predicting to myself that I will have to show this blog post to so many people.



[1] Domesticated primates - probably a reference to Timothy Leary or Robert Anton Wilson - approx. perev.

Also popular now: