Git wins, literally

According to Bitbucket, new users create 100 Git repos for every Mercurial repo created. Citing the high cost of supporting such a “minority” use case, Bitbucket announced that they are sunsetting Mercurial support,

Over the years I have enjoyed using Mercurial. Git was always my “go-to” for version control, but I wanted to see how Mercurial stacked up, so I used it on a few private Bitbucket repos – including the one that stores the source for this web site and its Lua-based markup-to-HTML generator.

I found simple things simple with Mercurial, but more complicated things became much more complicated, and sometimes impossible. In one repo I accidentally created a new head and had such a hard time getting rid of it that I just converted the repo to Git and fixed it there. I’m sure, if you are a Mercurial fan, you’ll say “well, you don’t know what you’re doing”, which is probably true. But while Git is complicated to the point of being unapproachable – it took me six months of reading the docs and playing around before I used Git “in anger” – it has never surprised me, let me down, or lost any of my work. The documentation can be rather inscrutable, and there are areas of Git that are dark to me (the email tools, the left-right merge stuff, rerere), but in general if I have an idea of something that I want to do, I can usually figure out a way.

I have always enjoyed using Git.

This was less true with Mercurial. It is much more approachable, but more limited. And I hugely prefer the sophisticated (and complicated) way that Git handles branches.

While I’m sad that Bitbucket is dropping Mercurial support – I really liked that there was an alternative to Git, especially for the Git “haters” out there – for me it’s not a big deal. It was a playground for me, and not really “mission critical”.

Conversion to Git, and Bitbucket UX troubles

After Bitbucket’s announcement, I went through all my Bitbucket repos and converted the Mercurial ones to Git. Since GitHub now offer unlimited private repos in their free plan, I went ahead and pushed all my Bitbucket repos over to GitHub.

As a backup? I’m not sure yet which platform I want to use as my primary storage for repos.

Bitbucket has serious UX problems. In the process of trying to find all my Mercurial repos, rename each one with a “-hg” suffix to make it obvious (since the UI also has no way of showing, in the list view, whether a repo is Git or Mercurial), and then convert them to Git, I discovered that the interfaces (I found two) for viewing all your Bitbucket repos are broken. There is no way to sort by name, which is exactly what I wanted because then “repo” and “repo-hg” would be next to each other, and I could more easily track my “renaming and converting” process.

The default (and only) sort is by “last-modified”! Since renaming a repo is considered a modification, just trying to rename my Mercurial repos wreaked havoc on the sort order. Really stupid.

In their announcement Bitbucket did not announce that they had created a handy tool to do a pushbutton, batch conversion of Mercurial repos to Git, instead simply pointing users to two open-source projects: hg-fast-export and hg-git.

I had good luck using hg-fast-export. (The documentation for hg-fast-export and the instructions in the online Git book are both good.) To suggest the scale of the effort, I have thirty-something repos in my Bitbucket account. Because of the manual nature of the conversion process, and because the Bitbucket UX is so terrible, this process took several hours spread over two days.

The future of Bitbucket and Mercurial?

Saddling users with big manual migrations because you no longer support your product is not a good PR move. Way to build trust with your users, Bitbucket!

Predictably, when the sunsetting was announced on the forum, it lit up, with users saying things like:

“I initially thought this was an April fool’s joke, then I realized it was August. The only reason we chose BitBucket over GitHub in the first place was because of the Mercurial support, so we really have no reason to stay with BitBucket if Mercurial is removed. A sad day indeed, but hey, the almighty buck wins out again over customer loyalty :(”

“Probably most Mercurial customers will either move their repos to another Mercurial site or else they convert the affected repositories to git and move to a provider with – let’s hope so – more long term service continuity.”

“If there is no automated script to make the transition, I’m afraid all my repos will migrate to GitHub.”

The announcement also suggested, to users who want to stick with Mercurial, that there are other vendors still hosting Mercurial repos. But why would they stay in business if the biggest player is exiting the market (because of shrinking market- and mind-share for Mercurial)? Sadly, it doesn’t look good for the future of Mercurial generally.

If you have the stomach for such things, you can read the comments on Hacker News about this announcement. Fortunately, just to keep things lively, at least one person mentioned Fossil! (You should go read about Fossil. It’s an interesting project, brought to you by the same folks that make SQLite.)

I’m wondering if this isn’t the beginning of the end for Bitbucket. They were founded as “GitHub for Mercurial users”. Then they added Git. Then they discovered that their users prefer Git to Mercurial. Then they axed Mercurial support. What now distinguishes them from GitHub?

There is a compelling reason for people to switch over to GitHub: the community on GitHub is four times larger.

According to the GitHub homepage, as of August 2019 it had 40M users and 100M repos. Bitbucket homepage doesn’t mention repo count but says “more than 10M developers” use Bitbucket.

For now I’m keeping my account on Bitbucket as a backup, but their fortunes could change quickly.