Comparisons between tools are always tricky. Firstly, many things like usability come down to personal opinion. Secondly, putting together benchmarks meaningful to a broad audience takes a lot of time to do properly and are frequently out of date within 3-6 months.
If you have the time, we encourage you to try out the different tools and judge their merits for yourself. Failing that, we suggest you try Bazaar first. As explained below, you can always switch to Mercurial or Git afterwards if Bazaar doesn’t meet your needs.
The top ten reasons for switching to Bazaar are:
We take great pride in making Bazaar easy to learn, easy to use and suitable for everyone, not just elite hackers. For example:
Ease of use is a core value for Bazaar and there are many places where our focus on usability shines though. We identify revisions using sequential numbers per branch, not per repository (like Subversion and Mercurial) or hash strings (like Git). Our GUI log dialog is intuitive, looking very similar to what Subversion and CVS users expect.
As shown, bugs can be associated with changes. Our storage format directly supports that: there’s no need to massage important metadata into specially formatted commit messages. Note also that many revisions can be expanded out to see the local commits made to deliver each larger change. That’s a natural consequence of using feature branching, a best practice Bazaar directly encourages.
It’s also important to think about the community you’re joining when you select a tool. The Bazaar community is very friendly and welcoming. We’ll do our best to get you going and keep you working efficiently, without making you feel stupid. As silly as it may sound to some, this is a huge deal to normal people - the very people Bazaar is designed for.
Some Git fans claim Git is now as easy to learn as Bazaar or Mercurial. With respect, we strongly disagree. For example, read and compare the help for the log command across the various tools: 4 pages for bzr log, one page for svn log, 26 pages for git log, and one page for hg log.
How many of the 26 pages of help for git log do you honestly understand? Could you explain it to everyone in your team? Wouldn’t you prefer a tool like Bazaar where log just does the right thing, following renames and sorting topologically, without needing to be specially asked? We certainly do.
Of course, log is just one command. Go ahead and repeat the above test on any other commonly used operation like add, diff or commit. Git is undoubtedly powerful but, in our view, it’s far more complex than a version control tool needs to be for most people.
Like any of the distributed VCS tools, one of the coolest features of Bazaar is that it’s distributed. This means that instead of having just the latest revision of the source code locally, you get a complete copy of the history for the branch.
This means that you can work while disconnected from a remote server, for example, while commuting. An operation like “log” is also very fast. Even if you are using a centralized workflow every user has what is essentially a full backup of the main branch. Each of these could be pushed back up to the main server in the event of a crash or corruption. There is no single point of failure with Bazaar unless everything is explicitly stored locally.
Bazaar can be adapted to use whatever workflow makes the most sense for your project, regardless of its size. If you are currently using a centralized workflow, Bazaar lets you continue to do so - you don’t need to change processes at the same time as changing tools. Distributed workflows can then be introduced gradually as they add value to your team.
Some examples of commonly used workflows are given below.
This is the workflow encouraged by Subversion and CVS. It works well for many teams and Bazaar directly supports it out of the box.
Another common workflow is where there is a gatekeeper - a single person who commits to the ‘main’ branch. There are also a number of developers who pull from that branch, push to their own independent branch and ask the gatekeeper to review their changes. If happy, the gatekeeper merges their changes into his/her integration branch and commits to the main branch. This is the type of development model you often see on open source projects.
More workflows supported by Bazaar are documented in our User Guide. In fact, our user guide is based around each major workflow, helping users learn solo development, partner development and team development practices as a natural progression.
Both Git and Mercurial are very flexible with respect to workflows as well. Bazaar is the only one of the three tools that supports bound branches though, an easier and safer way of implementing a centralized workflow than Git or Mercurial offers. Unlike pushing after a commit, a bound branch:
In fact, Bazaar is stricter about centralized development than Subversion. Subversion will only check that changed files are up to date locally while Bazaar will ensure your whole tree is up to date before committing to a bound branch. Why? It’s all part of our philosophy that the trunk ought to be ready to ship all the time. Used intelligently with automated testing, Bazaar can help keep the quality of your trunk as high as possible.
Bound branches are useful for many non-centralized workflows as well. It’s quite common for the gatekeeper to make their (local) integration branch bound to the (central) main branch so a single commit is all they need to do.
While Linux and Mac OS X are hugely important platforms for software developers, the majority of people - developers included - still run on Windows. Bazaar runs natively on Windows and has since the beginning. While Ubuntu is the platform of choice for most core contributors, we actively try to make users on all platforms feel at home. For example, platform-specific installers are provided and our documentation is available in HTML, PDF and Windows Help formats. We also take cross platform regression testing seriously, running our 22,000+ tests on all major platforms continuously.
Our GUI application, Bazaar Explorer, runs really well on all major desktop environments. As another example of making users on all platforms feel at home, separate visual tours are available for GNOME, KDE, Windows and Mac OS X users. Bazaar Explorer is available in a dozen languages (and counting) as well!
Beyond recording history over time, the primary purpose of a VCS tool is to help people work better together. A huge part of how well a VCS delivers in that regard comes down to merging, i.e. combining changes from different people together in a sensible and safe way. Smart merging is a hard problem. Different algorithms work better at different times. Using heuristics wisely is key, as is having the best possible metadata you can.
In Bazaar, merging Just Works most of the time. Here are some of the reasons why:
When our standard algorithm causes more conflicts than you expect, we offer the following features to allow more precise control:
In comparison, Subversion and Mercurial treat a rename as “copy+delete” behind the scenes while Git infers renames on request. Subversion, Git and Mercurial all treat directories as containers for files, not something that can exist and be tracked independently. Git supports octopus merging as well, while Mercurial does not.
Merging in Bazaar is also extremely safe. It’s always possible that a merge is fine textually but wrong semantically. Unlike Git, Bazaar and Mercurial won’t implicitly commit for you just because a merge appeared to work. We feel that’s a Very Good Thing. After merging in Bazaar, you can always run your automated tests and confirm they pass before committing.
The bottom line is better code and less friction between team members:
See Renaming is the killer application of distributed version control for Mark Shuttleworth’s view on this topic.
Once upon a time, Bazaar was much slower than Git and Mercurial and less efficient on projects with deep history. Bazaar 2.0 changes things completely.
To compare the tools, we grabbed the Mercurial repository for one of the largest and best known open source projects: Firefox 3.5. We migrated the repository to Git 220.127.116.11 and Bazaar 2.0.0 via hg-fast-export + xxx-fast-import. We then ran the magic command needed to compress the git repository (git repack -adf --window=250). Here are the repository sizes for each tool:
For more figures, see our benchmarks. Bazaar 2.0 is now clearly more efficient than Mercurial 1.3 regardless of project size. That means less disk space being used and less data being transferred across the network. Head-to-head with Git, Bazaar remains less efficient on some large projects while coming out on par on (the more frequently found) small-to-medium sized projects we’ve measured.
With great storage efficiency, Bazaar 2.0 now shines on many network-centric operations. Furthermore, you only pay for the revisions you care about when transferring data with Bazaar, not every single revision in every single branch. See shared repositories and stacked branches to learn more about our unique storage architecture.
What about commonly used local operations? To compare the tools, we made a change to a file and timed diff, commit and log:
Look at those numbers closely: Bazaar is taking around a second to make a commit on a tree with 38k files and just over 3 seconds to log a branch with 20k revisions! Git is faster but Bazaar is clearly fast enough for 99.9% of users. If Bazaar 2.x is genuinely too slow for you on your project, please tell us where and we’ll do what we can to fix the problem for you.
Ultimately, raw speed matters but the real challenge is overall user productivity. As more and more users begin using GUI applications instead of the command line tools, the time required to achieve tasks will be more dependent on how well the UI is designed, an area where Bazaar arguably excels.
Bazaar lets you organize your local workspace any way you want.
Want to use a local checkout like Subversion?
Want to use feature branches like Mercurial?
We encourage that as the best way of working for many projects.
Want to use a shared tree across multiple branches like Git?
We support that with ease as well. In fact, you can store your branches in one place (that’s easily backed up say) and put your shared tree in another location if you like.
No other tool is as flexible as Bazaar in this regard.
Bazaar transparently supports foreign branches for Subversion, Git and Mercurial repositories. This means you can use normal Bazaar clients and commands on these - special commands are generally not required!
See our tutorial for an introduction to using Bazaar as a Subversion client. As of Oct 2009, Git and Mercurial integration is less mature but rapidly progressing along the same lines.
Here are some of the cool features Launchpad offers:
Of course, there are many hosting sites, both for Bazaar and for other VCS tools. As of October 2009 though, arguably no other site is as good at helping you build a community and run a project as Launchpad is.
Some hackers like writing shell scripts using Git’s low level “plumbing” commands. We believe an open, supported, cross-platform API is a better way of extending and integrating with a VCS tool. See our integration guide to get started with bzrlib. You can also integrate in a more limited way via XML on the command line. Not a Python programmer or XML fan? We have .NET and Objective-C bindings in progress that may better meet your needs.
Like Bazaar, Mercurial also has a plugin architecture and Python API. Subversion also has many language bindings, though no equivalent plugin architecture.
Here are some important features in other tools we need to do better at ...
Here are some features in other tools we have alternatives for ...
Is Bazaar missing some other feature you need? Please let us know. If you’d like to help, please see our developer documentation.
Some people also ask about non-technical things like...
In short, choosing Bazaar is a very safe choice. Above all, it’s dead easy to use and suitable for everyone in your community/team, regardless of their role or platform of choice. Give it a try!