March 12th, 2013 by Benjamin Pollack
Announcing Kiln Harmony: the Future of DVCS
For the past year, the Kiln team at Fog Creek has been increasingly silent. Sure, we’ve shipped bug fixes and a few nice new features, but there’s been a definite feeling that things have been slowing down, and we know a lot of you were wondering what on Earth we were up to.
We were locked in a year-long development marathon to bring you an amazing, secret product, and we’re ready to let you in on that secret project right now.
Today, we’re shipping Kiln Harmony. While Kiln Harmony ships with piles of new features, from SSH support to IP white-listing to better services integration and more, we want to focus on exactly one major feature today:
Every single repository in Kiln Harmony can be used from both Git and Mercurial. Simultaneously.
You read that right. The war is over, and everyone wins.
Ending the Flame War
There are quite a few hosting products right now that support both Git and Mercurial, but these tools always require you to pick which DVCS you’ll use on any given project. In other words, their support is an either/or proposition: it supports either Mercurial or Git, but not both on a given project at the same time. That means you inevitably fight it out on your team on which DVCS gets to win. Pretty soon, your Mercurial and Git users aren’t even talking to one another, the company goes bankrupt, and you’re contemplating arson for the insurance money.
That ends now. A repository in Kiln Harmony is a repository in Kiln Harmony, and each repository fully supports both Git and Mercurial. No more flame wars, no more fights. Just productive coding.
How it Works
Under the hood, Kiln Harmony has a bunch of voodoo that translates Git data to Mercurial data and vice-versa in a way that is repeatable, lossless, and idempotent. That’s a really fancy way of saying that a given Mercurial changeset will always become the same Git commit and vice-versa, even if you use that repository on another hosting service or move it to a new Kiln installation, and that we don’t lose any information in the process.
We’ll have a whole series of blog posts this week on the technology that makes that possible, but for now, I want to focus on how you can actually use Kiln Harmony.
The Magic Drop-Down
This is the yin-yang Kiln Harmony drop-down. If it is possible to fall in love with a drop-down, we know you’ll fall in love with this one. Whenever you’re exploring in Kiln—whether in a review, browsing history, looking at files, or reading a diff—simply click this little widget to switch between viewing the page in Mercurial or Git mode.
Most of the time, you’ll notice absolutely no difference—and that’s a good thing! If a file or a diff looks a given way in Mercurial, it ought to look the same way in Git. But in those few cases, like subrepositories and submodules, where Git and Mercurial have different ways to do something, you can see the difference with two clicks of a mouse.
There is one area where Git and Mercurial work pretty differently: branching. We really wanted this to be no-compromise: Mercurial and Git users shouldn’t have to change their workflows to work with each other. How do we handle that in Kiln Harmony?
First, the easy case: it turns out that many published Git and Mercurial repositories actually only ever have one branch in them to begin with. In those cases, we’ll automatically keep the Git
master branch in sync with the Mercurial repository’s
tip transparently. So far, so good.
What about multiple branches? That turns out to be a lot easier than you’d think. The past several versions of Mercurial have had a concept called bookmarks, which work similarly to Git refs: they can be added or deleted, they don’t have history, and you can be “on” one when you’re making changes. So, at a high level, Git branches just become Mercurial bookmarks and vice-versa.
There’s a bit of voodoo here, though, for a couple of reasons. Mercurial allows anonymous heads, which is a fancy way of saying that not all active branches necessarily have distinct names. Git doesn’t allow that. Mercurial also has a concept called named branches, which Git lacks. What do we do with those?
Kiln Harmony’s got you covered: we’ll provide bookmarks on all anonymous heads, so that all Mercurial changesets are also accessible from Git. If you use named branches, we’ll translate those into Git refs as well, so that when you refer to branch
foobar, Git users will know what you’re talking about.
There’s one other little footnote, though: what about Mercurial users who have never used bookmarks before? Do you have to learn bookmarks to work with Git users through Kiln Harmony?
We actually think bookmarks are awesome and you should learn them even if you’re not using Kiln Harmony, but the general answer is, “No, you don’t.” Kiln Harmony is smart enough to infer what you meant even if you never want to play with bookmarks, or if you’re using a version of Mercurial that’s so old you don’t even have them. If you make changes that correspond to a bookmark, we’ll automatically move both the bookmark and the ref when you push.
What about everything else?
There’s a lot of magic that goes into Kiln Harmony. Rather than try to cram all that material into a little blog-post, we’ll be running a series of articles in the coming days on how Kiln Harmony works. We’ll take you under the covers into the details of our implementation, how we handle bizarre corner-cases, how we handle data formats that are more defined by their violations than their nominal structure, and more. If you’re the kind of person who loves reading about that kind of nitty-gritty detail, then you’ll probably enjoy reading our detailed articles on exactly how Kiln Harmony works. You can also sign up for the Kiln team’s live Q&A next week.
How do I get it?
Beginning today, all new Kiln On Demand accounts automatically come with Kiln Harmony. If you don’t have an account, make a free trial and you’ll have Kiln Harmony in minutes. For our existing Kiln On Demand customers, we’ll be upgrading your accounts over the next couple of weeks. If you want to jump to the front of the queue, just drop us a line and we’ll make sure you’re one of the first accounts upgraded.
Where do we go from here?
Kiln Harmony is an incredible product, and while we think you’ll love it today, we’re going to continue making it faster, more powerful, and even easier-to-use in the months to come.
In the meantime, welcome to the flamewar-free future.