by mgd · 3y ago · 0 comments
Personally, I chose Mercurial to start with, because I liked the Windows tooling available and it felt a lot more like Subversion, which is what I used previously.
However, Git won the mindshare war in the end, so I moved over to that.
Ahhhh, thanks for brining back those memories.
You're not thinking about BitBucket are you? I thought Github was always git only?
That was over a decade ago, however; I'm actually pretty surprised it took Mozilla so long to switch.
I'm a happy git user but I'm really curious about losing good ideas from other tools due to mindshare.
However the killer feature of Git is the ecosystem. I was always having to do lots of custom work to get Mercurial to work with CI providers, whereas Git just worked and had first class support. It was clear after a while that our team would always be outsiders if we continued down that path, and there wasn't enough of a compelling reason to stay with Mercurial.
hg has (had?) a sane CLI that blows (blew?) git out of the water.
I like the power of git, but it either needs external tooling to prevent people from shooting the team in the foot, or relatively thorough study by everyone using it.
In practice, for git, most of the time you need some software to protect people from messing up repositories and history (gitlab, github, etc, which honestly you're gonna use anyway), while hg on its own protects you out of the box from most mistakes.
All FAANGs I'm familiar with use git, but there are some serious handrails and straps on what you can do. On smaller companies I had so many arguments about rebasing public branches that it's not even funny.
For a while I had in the back of my head to create a hg clone that was a wrapper around git, in a way that it'd allow hg-style workflows and protections, while having a faster and more well-known "backend".
If git was an equivalent modern appliance, it would be against the Geneva convention.
I give Git this, it's a bit faster.
Edit: I work for Mozilla, although I didn't in 2006 when I think the decision was made.
But Rails was a very early Github user, and the big Rails usage upswing coincided with that and helped drive it. I was a Python and PHP dev at the time, and that other stuff mostly predated Github and was scattered across all kinds of places. Whereas Rails and Github both kicked off about the same time, and practically no Rails devs or libraries used anything else.
It was that fast growth and hype combined with the network effects of Github that drove git usage rather than what Linux used. The Linux contribution workflow was also pretty alien to Github focused webdevs.
That's how Sourceforge rose to become so dominant it appeared unstoppable, and how Docker became immensely popular so quickly.
Bitbucket also had free Mercurial hosting in 2009. I think it was 1 private repo in the free plan and it was later expanded to unlimited free repos with max 5 users around 2011.
So Linux was always going to be git; and I think things flowed from there.
There wasn't a similar offering for Mercurial, in part I think because of the fundamentally different way Git and Mercurial treated (treats?) branches. In Mercurial branches were permanent, so a PR-like flow would leave a lot of stale branches around.
Mercurial also didn't support rewriting history as a core philosophical choice.
It was introduced via a plugin but that meant each dev had to enable it to use it. AFAIK it has been moved into the core, but I think too late.
At least as a primarily Mercurial user at the time, I feel Git didn't really outcompete Mercurial until Github and PRs came along. It just allowed for much smoother cooperation.
But those are big company problems and I suspect the caveats, tradeoffs and solutions matter a lot less for the 99 % of other VCS users.
But Git definitely won the war, and Mercurial has been disappearing little by little.
Might not have much to do with git vs Mercurial technical merits.
Still, with Linux behind it, Git won the DVCS wars. Mercurial became an also-ran and now almost nobody uses it.
Too bad.
We'll need something new and innovative to come out and rid us of constant blogs explaining how Git works because it's too hard to understand how to make it do the things you want it to do.
I've been using Git for about 7 years now (5 exclusively) and I know how to use it, but I still have to look things up occasionally because its UI is trash and non-obvious. I didn't have that problem with Mercurial. There, I knew the verb and the built-in help was sufficient to get me where I wanted to go.
Worse is better wins again.
Just try to clone Mercurial repo (Firefox) and roll back in history to specific commit. Let me tell you beforehand - it is (at least used to be) impossible. What you could do is to "clone it again" up to specified point. You have to do it somewhere else on a filesystem just to needlessly spoil disk space and you end up having the same sources at least twice. When I asked why I got handwaving arguments about code history being sacred, which is of course nonsense. If it was so... in Git I'd make another branch and rewind to commit I care about without wasting another 25gigs of disk. How can be this achieved in mercurial these days (without waste)? Back in days I wanted to do some work specifically on Firefox, and those steps were the only I could come up with after a lot of searching and asking questions, and because of Mercurial I gave up, to me it felt like it was a high entry barrier on purpose.
So, no my friend, a lot better wins time.
hg clone ssh://example.com/repo
cd repo
hg update -r $SOME_COMMIT_HASH_OR_ID
```
Unless you mean you want to delete history back to a certain point, in which case it's only slightly more complicated.
Ten years ago, when I had started to use git after having used both Subversion and Mercurial, I noticed one thing.
Git was FAST.
On repositories of the same size, git was blowing Mercurial out of the water and running circles around it, that's how fast it was.
It was FAST and it fucking got out of my way and let me work.
I don't know the inner workings of either and academic advantages of Mercurial, but I know for a fact it had been a dog and its move to Python 3 had been disastrous. So whichever technical or UX advantages Mercurial might have, I simply don't care anymore.
Then git-svn was born, and you could branch instantly. This was such an obvious improvement that all future repos moved to git.
Read about Jujutsu awhile back.
But not for the reasons that correlate, such as education, tooling.
https://soberbuildengineer.com/blog/2007/04/version-control-...
https://soberbuildengineer.com/blog/2006/11/version-control-...
Unfortunately, GitHub got VC funding and caused network effects to kick in.
Git came along with GitHub as a parasite much like C came along as a parasite with Unix.
Actually, it scales well with large codebases, but the monorepo mental model pushed by FB/Google doesn't match the git workflow model. Git repo design is for a concrete entity: a single tool, binary, service, kernel, whatever. When you start bashing in multiple unrelated projects where you try to have various per-project versioning schemas, it becomes a mess.
I don't really see a benefit of having all code of an org in a single repo. Single product, sure. But whole company? Why. Not to mention, these are serious outliers.
From security standpoint, it doesn't seem great, from practical side, it's not great (bandwidth cost ect).
It's more complex comparing with git naked graph. Contains more domain entities. But it could be more convenient for starters and SVN users.