You are here

Bazaar or Git or Mercurial for version control?

Submitted by Peter on Fri, 2010-07-30 09:29

Bazaar or Git or Mercurial for version control? First Bazaar was in fashion then Git. Now Mercurial gets a lot of attention. There are only a few real differences and, with the release of Bazaar 2.0, those differences are going away fast.

Version control

When you develop software or update files, you need a way to manage the versions of files you are using. You need to see the history of changes to find originals and you sometimes need a way to wind back the clock to an earlier version. Some of the features might be added by plugging in extra modules to give you the features you want without overloading the system for people who do not want those features. Look at some examples.

Example problems

You publish a special offer on your Web site to sell a product with free delivery. Your special offer page uses an old picture of the product so you change the page to use a new image you find in one of the image directories. You are then sued for misusing a copyrighted image. This happens when someone copies a copyright image then trims it to a new size. You know that file a1234.jpg is copyright, you might guess that a1234_small.jpg is based on the copyright image, but not notice the connection when the image is renamed to jewelery_silver.jpg. You need something that shows the history of how the file was created. You should be able to see who loaded the image and when. You should be able to see the history of the image before using the image. A good version control system lets you record all relevant information including copyright ownership, who made the changes, and why.

Jack and Jill work on improving your Web site home page. Jack adds special code to feature a new product special offer each day. Jill adds a colour preference selector. Jack adds his change at 4:45 pm then drives off into the wilderness with no telephone or Internet access. You start adding weekend specials and book expensive advertising to drive new customers to your specials. Jill copies her version of the Web page into the system at 4:55 pm, wiping out Jack's change and making all the advertising useless. What is needed is a system to warn Jill that someone else changed the page, to perform a comparison then, possibly, merge Jill's changes into the updated page.

CVS

The first version control systems were commercial and some had many fine features including control. CVS, www.nongnu.org/cvs, is the oldest open source version control system and had only two advantages, it was free and it had a single central copy of everything. CVS lacked control. CVS lacked features and you needed endless add on modules just to make a basic working system. The add on features did not add real control. CVS was restricted to community development of open source projects. Anything else was a lot of work for not much gain.

Subversion

Subversion was a minor improvement on CVS. Think of CVS as a car with only one wheel installed. Think of Subversion as a car with a second wheel added. Better but still not complete. You still need a lot of add-on modules.

Distributed version control

One of the advantages and problems with Subversion and similar version control is the central repository. You get the advantage of having one true version of everything. You get the disadvantage of relying on access to the central repository. Distributed version control lets you create multiple repositories and synchronise them automatically. You still have to decide which one published to your Web site.

Users of distributed version control systems usually create a single central system for publishing and have a limited range of people who can update the central copy. Everyone else works on distributed copies and arranges their own way of merging their work. The crowd of other might form teams to work on specific related problems or in similar areas. They then offer packages of changes to the controller of the central system.

Bazaar

Bazaar was the first big success in distributed version control. Being first, the developers made some choices that gave Bazaar a bad reputation for complexity and slow performance. Today the Bazaar people claim Bazaar has the easiest interface and performs equal to the competition.

Bazaar is at bazaar.canonical.com. The one big advantage of Bazaar is support from Canonical, the people who produce Ubuntu. Canonical host software development in Launchpad which uses Bazaar. When you choose to use Launchpad, you get an easy way into the Ubuntu distribution and end up using Bazaar.

There are lots of old performance comparisons online showing Bazaar dragging the chain. I have not found an up to date comparison. Distributed version control makes development quicker by working from a local copy of the repository and the only really slow bit is the synchronisation between repositories, something that can run in the background while you do other things.

Bazaar publish a page on Why Switch to Bazaar? When you read the part about workflow, look at Gatekeeper Workflow because it is the one you will use most. The page refers to Bazaar 2.0 and reports Bazaar 2.0 as faster than Mercurial but not as fast as Git, plus Bazaar 2.0 uses less disk space than Mercurial but more than Git.

Git

Git was the second distributed version control system to hit the big time in popularity. Git used a better repository structure to get better control and performance. Bazaar eventually switched to the Git repository structure. Git is the leader for saving disk space and reducing processing time. Bazaar 2.0 is now a close second.

Git is used to maintain the Linux core. Git is written in C which should make Git fast. The Linux oriented Git developers appear to have little interest in making Git really easy to use or completely cross platform. The problems with use of Git outside of Linux make be put Git at the bottom of the selection list and the minor performance advantages of Git are not worth the extra work.

Mercurial

Mercurial is the current fashion. Mercurial is selected by a lot of people for similar reasons. Mercurial is faster, a lot faster than the old Bazaar but only a little bit faster than Git. Mercurial is considered easier to use compared to Bazaar and Git from a few years ago. The differences in user interface and documentation change every year so do not be mislead by all the online comparisons that are old or do not specify the date when the comparison was made. Bazaar 2.0 appears to be slightly faster than Mercurial.

The Web site for Mercurial is mercurial.selenic.com. A quick look at the Mercurial site is enough to stop many people using Mercurial. All the examples of use are based on command line text entry. This is the rubbish that programmers had to put up with in the 1950s when the only input device was the teletype.

In the 1960s Doug Engelbart at the Stanford Research Institute invented the mouse and the elements of a graphical user interface. A few years later a team at Xerox PARC invented Windows. Many years later Microsoft and Apple cloned the Xerox PARC graphical user interface then Apple sued Microsoft claiming that Apple invented Windows.

Despite all misleading marketing crud from Apple and the awful Vista version of Windows from Microsoft, the graphical user interface (GUI) is really useful and productive. Only a few primitive lifeforms, usually called Unix system administrators, keep the command line alive. You do not need it for version control. The Mercurial Web site is telling us that Mercurial is aimed at the 0.00001 percent of creatures with a secret desire to return to 19811 and use Microsoft DOS.

How can you tell if you will find the command line interface more exciting than GUI interfaces? You prefer dial up access to broadband. You make all your Ethernet cables by hand carefully crimping the lugs on the end of raw cable. After you attend a pasta making class, you try to make a fettucine machine out of old Linux CDs. You have a ponytail and you are not a pony.

Switching sides

You can export from Bazaar, Git, or Mercurial, using an export format developed by Git. you can then import into Bazaar, Git, or Mercurial. If Mercurial looks better than Bazaar, you can easily move from Bazaar to Mercurial and then move back if you change your mind.

Switching applies only to the basic version control. When you add extra modules, you may create data that cannot be processed by modules in a different version control system. If you decide to use version control on images and use an add on module to extract the Exif information from JPEGs, you would have to find an equivalent module in the other version control systems. There might be an equivalent module but the other module might store the extracted data in a different incompatible format.

Extra modules

I looked for modules to extract Exif information from JPEGs and to store the information in the repository so I could automate the version control of images. I did not find a module for any of the modern version control systems. Things like this keep people using CVS. you develop an add on module then another. Soon you cannot change because of the investment of time in the modules. One advantage of open source is that you can donate the modules to the community and possibly pick up assistant maintainers to reduce the workload.

Conclusion

Git has too many problems and will probably die out. A lot of people prefer Mercurial because they used Bazaar 1.0, or Git, and found Mercurial easier. The Bazaar 2.0 page makes me want to use Bazaar 2.0. Launchpad is another reason to use Bazaar. The large range of Bazaar add on modules, compared to the competition, is enticing.

References

1 What were Unix system administrators wearing in 1981? None dressed like Boy George. Some dressed like Adam Ant to attract chicks. The chicks tried to look like the stars of Dallas but without the expense account. Think big hair and bad clothes: Fashion Magazine Summer 1981

Technology: