logoalt Hacker News

dueyfinstertoday at 11:59 AM3 repliesview on HN

I never had a good experience with mercurial from memory. Docs and examples weren't as good (not that Git was hugely better, but network effects had more resources available). I remember the CLI commands being a small bit more intuitive but as someone new to DVCS at the time (as most people would have been) - it didn't really do anything special to help new users get a handle on the mental model for how it works. I remember Facebook publicly using / backing it, was surprised they didn't do more to promote it.


Replies

GuB-42today at 1:51 PM

I used Mercurial before Git and found it way more intuitive. I don't have much to say about the documentation, I didn't have a problem with it, but that's not the reason.

It is not just because the CLI is more intuitive, though it plays a big part.

The main reason is that mercurial is more opinionated. On a default setup, only a few commands are available, and none of them let you change the history. If you want more, you have to add an extension. These are built-in, that's just a line in a configuration file, so that's not much of an obstacle, but you have to be deliberate. It gives a natural progression, and it better defines the project organization.

With git, you have everything and the kitchen sink, literally, as it uses the "plumbing" and "porcelain" metaphor. All flavors of merge, rebase and fast forward are available, there is a git-reset command that does a dozen of different things, there is stash, the staging area, etc... The first month or two on git, I was a bit overwhelmed, none of that with Mercurial, and I already had the experience of Mercurial when I switched to git, so I was familiar with the concept of push/pull and DAGs.

Now, I tend to prefer git, though after many years, I still have trouble wrapping my head around the command line sometimes. But that's for the same reason it was so hard to me to get into it. It gives out a lot of freedom and possibilities. For example, I like the fact it is really decentralized, for example in one project the customer had a completely separate central repository we couldn't access, and they couldn't access ours, for security reasons. We worked by exchanging bundle files. At some point we also took advantage of the fact that it is possible to have more than one root commit. Also, almost all mistakes are fixable and it is hard to really lose anything (including secrets, so beware!).

For a video game analogy, Mercurial introduces you to new game mechanics as you progress, while Git makes you start in the middle of the map with all the skills unlocked.

rokobtoday at 1:46 PM

Facebook moved to mercurial because of specific problems related to the size of their monorepo. Moreover the git maintainers were unwilling to work with Facebook to improve git to solve some of these problems. Mercurial was a better fit and was open to the help. But all that said if you don’t have a truly enormous monorepo like Facebook or Google then git is arguably the better tool given the network effects. I don’t think Facebook wanted to promote Mecurial as some vastly superior solution outside because for most people it isn’t.

show 1 reply
amenghratoday at 1:22 PM

Facebook moved from subversion to git around 2008. Some of their teams then switched to mercurial around 2014 (I could be wrong by a couple years here or there). By 2014, git was already the main tool everyone was using —- no amount of backing by a single company would have tilted the scales.