Why Switch to Bazaar?

This document is here to explain why people are switching to Bazaar from other tools, and why you should too. For alternative perspectives, see Why Choose Mercurial? and Why Git is Better Than X.

Note

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:

  • Version control for everyone
  • Work offline
  • Any workflow
  • Cross platform support
  • Rename tracking and smart merging
  • High storage efficiency and speed
  • Any workspace model
  • Plays well with others
  • Launchpad
  • Plugins and bzrlib

Version Control for Everyone

We take great pride in making Bazaar easy to learn, easy to use and suitable for everyone, not just elite hackers. For example:

_images/welcome-new-project.png

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.

_images/dialog-log1.png

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.

Note

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.

Work Offline

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.

Any Workflow

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.

Centralized Workflow

This is the workflow encouraged by Subversion and CVS. It works well for many teams and Bazaar directly supports it out of the box.

_images/workflows_centralized.png

Gatekeeper Workflow

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.

_images/workflows_gatekeeper.png

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.

Why is Bazaar better exactly?

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:

  • Checks you’re up to date with the central repository before making the commit.
  • Effectively makes the commit centrally before allowing the local commit to succeed, enforcing true lockstep development.

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.

_images/dialog-commit-to-bound-branch.png

Cross Platform Support

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!

Rename Tracking and Smart Merging

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:

  • Renames are properly tracked.
  • Directories are first class objects. Directory renames are tracked, not just file renames.

When our standard algorithm causes more conflicts than you expect, we offer the following features to allow more precise control:

  • Bazaar supports “octopus merging” - merging from more than 2 parent revisions.
  • You can remerge using another algorithm to see if that produces a better result.

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:

  • Thanks to true rename tracking, users are liberated to refactor directory and file structures as they see fit, without fear of merging problems.
  • Pre-commit regression testing means your trunk is always in good shape. That means less time is spent chasing down regressions accidentally introduced into the trunk.

See Renaming is the killer application of distributed version control for Mark Shuttleworth’s view on this topic.

High Storage Efficiency and Speed

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 1.6.3.3 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:

_images/chart-size.png
Mercurial Git Bazaar
311M 124M 137M

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:

_images/chart-diff.png _images/chart-commit.png _images/chart-log.png
Operation Mercurial Git Bazaar
diff 0.622s 0.156s 0.916s
commit 1.126s 0.348s 1.030s
log 3.449s 0.402s 3.205s

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.

Any Workspace Model

Bazaar lets you organize your local workspace any way you want.

  • Want to use a local checkout like Subversion?

    No problem.

  • 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.

_images/dialog-init.png

Plays Well With Others

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.

Launchpad

Launchpad is the collaboration platform on which the hugely successful Ubuntu operating system is built, along with 14,000 other projects including the MySQL database server.

_images/launchpad.png

Here are some of the cool features Launchpad offers:

  • Teams and mailing lists
  • Release management - series and milestones
  • Software distribution - downloads and Personal Package Archives (PPAs)
  • Bazaar code hosting and reviews
  • Code imports from CVS, Subversion and Git
  • Web-based translations to multiple languages
  • Answers to frequently asked questions
  • Bug tracking (cross-project if required)
  • Lightweight specification tracking
  • Web-services API
  • Fully open source (unlike most competitive sites)

For an introduction to Launchpad, take the tour. To see how Bazaar and Launchpad work together, read our tutorial.

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.

Plugins and bzrlib

Bazaar has over 100 plugins that extend its core capability. See the plugin registry for an overview and the Plugins Guide for more detailed documentation on some of the more popular ones.

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.

Note

Like Bazaar, Mercurial also has a plugin architecture and Python API. Subversion also has many language bindings, though no equivalent plugin architecture.

What about ... ?

Here are some important features in other tools we need to do better at ...

  • CVS’s Eclipse integration: Our integration with Eclipse is less mature but progressing nicely. See the qbzr-eclipse add-on. A more tightly integrated (but currently less functional) alternative is also available.
  • Subversion’s externals: The Bazaar team is working on a similar feature called nested trees. This is a complex feature to get right and we aren’t prepared to roll something out that we can’t support in the long term. Until nested trees are available, we recommend trying the scmproj plugin.

Here are some features in other tools we have alternatives for ...

  • Mercurial’s Queues: The loom plugin is great for managing an ordered list of “threads”. The pipeline plugin is great for developing a large change as a series of patches.
  • Git’s staging area: This is a useful feature for some users some of the time. If a user wants to commit a subset of the changes in their working tree, Bazaar offers several options:
  • partial commits - just commit specific files or directories
  • shelve/unshelve - store away the stuff you don’t want committed right now, do the commit, then restore the shelved changes back into your tree
  • filtered views - setup a mask that implicitly applies to bzr actions.

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...

  • Bazaar is dependent on Canonical isn’t it? Bazaar is a highly successful open source project in its own right with almost 300 contributors to the Bazaar 2.0 code base. If Canonical disappeared (extremely unlikely given Ubuntu’s success), we expect the code base to thrive regardless. Canonical does pay the salary of many core contributors. We think that’s a Good Thing. It means unexciting stuff (like great documentation) gets done properly. It also means a well-manned IRC channel and the availability of commercial support.
  • Will Bazaar be the winner over Git and Mercurial? Predicting the future is hard. We believe Bazaar, Git and Mercurial will all continue to be successful and grow large user bases going forward. Unlike the good ol’ days when CVS reigned supreme, it seems most unlikely that there will be a single dominant VCS tool in the future. In the event that we’re wrong and another tool completely takes over, you can use fast-export to switch your code base across if and when another tool better meets your needs.

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!