Comparing Popular Version Control Systems

Toturial

Introduction

Why another comparison review!!?

Perhaps because many of other reviews are either outdated or unfair.a

What's the difference between this and the others!!?

There are some differences.

  1. Most of the current reviews are written by a user of one of this softwares so the author can't be fair since he has much less experience with the others, in this article however i only write about Bazaar and let the users of other DVCSs to participate and write about their favorite software.
  2.  There are many resources available regarding to this topic and each one has pros and cons. But the main issue i have with them is that most of them are outdated because all this DVCSs are under very active development. An issue that exists now, might become a feature! few months later. So i started this article as a research project which means that just like DVCSs it's also under active development :). Anyway if you like to read resources on other sites i suggest you to check the date they've been published before relying on them. (You can subscribe to this page's RSS/Feed in order to be notices of the new updates.)
  3.  This article is practical because it includes personal experiences from users of all these DVCSs, and challenges they've faced using them ,not only what's been written in Documentations
  4. I try to prevent long boring disscussions between each VCS users! i'll share my opinion at the end plus some other developers so you can see which one suits you best :)

There are two well known type of version control systems, Centralized(Like Subversion) and Distributed(Like Git). In this article i'm not going to describe the differences between this two, however it's important to understand how they work before making any decision. This article can be a good starting point. I consider centralized VCSs an expired type of VCS so i start with comparing distributed VCSs and if you're about to start using VCSs i suggest you start with a distributed VCS. Note that distributed VCSs like Bazaar also support Centralized VCSs Workflow.

It's about the sixth years since my first commit using Subversion, Moving from CVS to Subversion was eally amazing, Subversion was superior in many ways and it served me well. But the age of centralized version control systems is over, we need much more powerful VCSs to deal with huge projects. Now days we should to be able to work with anyone, on anything, anywhere , at anytime, and also keep track of all this activities.

The age of single all-in-one solution is over in many fields including Version Control Systems, each solution has its own pros and cons and Same applies to VCSs. So in this article i'm going to compare three major DVCSs available.

My main focus on this article is Bazaar since i've decided to start (You can read why i decided to start with Bazaar at the Conclusions section) but i asked my friend Alfted who is a Mercurial(HG) user to help with all sections related to HG. Kudus to him. Currently i use whygitisbetterthanx.com site for Git but i'm also looking for Git user to share his personal experience by using Git with me. So if you're Git user i'll be more than happy to hear your opinion :)

Understanding Concepts

Distributed version control system is a whole new world, with many new concepts to learn. I'm not going to write about this concepts in this article, however during my research i stumbled upon many good guides and documents that i found quite useful specially for newbies. So i'll share them here with you.

Bazaar

A great document by nice fellow Matthew Fuller (fullermd at #bzr IRC channel) which helps you undertand the key concepts of bazaar :  MatthewFuller/SpotDocs/PiecesInBrief - Bazaar Version Control

History

Bazaar

C, Python

Git

Written in C/C++, Perl, bash scripts

Mercurial

Written in C, Lisp, Python

Installation

Bazaar

Karmic :
Add this repository for Bazaar gui (known as bazaar explorer)

ppa:bzr-explorer-dev/ppa

If you're not using Ubuntu Karmic more information here :  https://launchpad.net/~bzr-explorer-dev/+archive/ppa

sudo apt-get install bzr bzr-explorer bzr-svn

Migration

Obviously any DVCSs without proper migration utilities is useless for most projects, so lets see what each one has to offer.

Bazaar

To get started with bazaar as fast as you possible with subversion background : BzrForSVNUsers - Bazaar Version Control and Bazaar for Subversion users — Bazaar Migration Docs

You might want to have look at Migrating from Subversion to Bazaar (Including special guide for Sourceforge projects)

Note : While i was trying to migrate one of my sourceproject from svn to bzr, i came into some very nasty issue due to the difference between server and local bzr version, however bazaar developers say that in 2.x serious and upwards it's no longer a issue. bazaar supports various different tree formats which can causes lots of headaches. this command helped https://sourceforge.net/apps/trac/sourceforge/ticket/517

Performance

Bazaar

Bazaar is considerably slower than the others however importing performance is work in progress.

Git

Git is really fast and i think everyone is agree on that.

Mercurial

HG is very close to Git so obviously optimization plays much more important rule than the programming language. and regarding whygitisbetterthanx.com here is Alfred's opinion :

  • ERRATA: C++ over Python is obviously faster
  • Graphs can't be right, since hg's tagging is another commit,
    therefore can't be slower
  • Unfairness: hg also has local tagging which is really fast, since
    it only edits a text plain entry
  • Slower task for hg would be building the change history log, due to
    the optimization on choosing whether to use snapshot/changeset, which
    directly impacts on detriment when gathering all the info at once
    (which is done only one time in a whole work session, since further
    operations over change log, including refresh are optimized)

Size

Git

Bazaar

Mercurial

Alfred :

I really don't know what would be the size of Django, but Drupal 7 is near 3MB and neither of those operations spent that much time (on my old P4 single core) 96 sec a branching?! are they insane?!

Features

All of the major DVCSs have the important features so i'll skip the feature that are available on all of them. Also this part is mostly a respond to whygitisbetterthanx.com  because it seems that the information they're providing is not accurate.

Cheap local branching

Bazaar

As far as i know Bazaar supports this feature, also it might be interesting to have a look at Filtered views — Bazaar v2.2.0dev1 documentatio

Git

According to whygitisbetterthanx.com git has this feature in a very good way!

Mercurial

Alfred : HG inherited good ideas from Git

Staging

Git

According to whygitisbetterthanx.com git has this feature in a very good way!

Bazaar

Bazaar has this feature but not out of the box, the only thing you need to do is creating another branch and bind you current branch to it, then commit you changes to that branch. when you're finished you can bind that branch to any branch you want and push/commit the changes! instead of directly committing your changes.

Mercurial

Just like Bazaar simulating it is not really a big deal. Alfreda has good point :

"staging"? just make up your mind and have precisely another "cheap branch" and name it what ever you like, or even better, another "staging" repo from/to which you synchronize (push/pull) when the resulting branch is of your likings. It is just a "personal workflow" matter, not need to become another feature to be learned.

History model

Bazaar

Alfred : Snapshot

Git

Alfred : Snapshot

Mercurial

Alfred : Changeset/Snapshot  

Network Protocols

Bazaar

Local, Secure Shell (SSH), Git, and HTTP and many more (Like FTP) via Pluging

Git

Local, Secure Shell (SSH), Git, and HTTP. Don't know about other supported protocols

Mercurial

Alfred : Limited

Tracking directories

Why tracking directories is important?

The main reason is it also means no empty directory! there are many applications with empty directories like temp , files , templates, cache as part of their structure.

Bazaar

Supported and it like it pretty much :)

Git

Not supported, Well i think that's the problem of using Version Control which is primary designed for an specific software (Linux's Kernel)

Mercurial

Not supported, it's mentioned in Mercurial offitial documentation that it's not possible to represent a completely empty directory just like CVS and Git.

My personal opinion is it's unacceptable for a modern VCS. Someone has mentioned in the documentations' comments that "Considering empty directory structures useless is simply a lack of imagination from the designers of the tool." and i'm totally agree with him.

Dedicated Free Hosting

Note That in my opnion it's not big deal since big free opensource hostings like Sourceforge already support this major VCSs!

Bazaar

launchpad.net

Git

github.com

Mercurial

bitbucket.org

Alfred's opinion regarding to whygitisbetterthanx.com

Don't know how many hosting might git have, but bitbucket.org has good performance so it is NOT out of capacity (plus they are .org instead of .com, and their agreement reads loud and clear while not so extensive: http://bitbucket.org/site/privacy/ vs http://help.github.com/terms/)

GUI

With lots of tools available out there , having a good GUI is getting more critical everyday and i think the main reason is because it decrease the learning curve dramatically.

Bazaar

TortoiseBzr for Windows' Explorer and Cross Platform BzrExplorer

Git

Haven't tried Git yet but as long as  know Git is the weakest one in this area.

Mercurial

TortoiseHg and it's very well designed. TortoiseHG is also cross platform.

There are many other options : http://mercurial.selenic.com/wiki/OtherTools

Integration

Software development without using third-party applications and IDEs is a waste of time! So we should able to use our favorite VCS via our favorite IDE!

Bazaar

Has a plugin for Eclipse, the installation process was not as smooth as subeclipse but i can't say that it was difficult. i had to manually add the bzr binary and plug-in folders location and also configure few options (All couldn't be pre configured). But according to BzrEclipse roadmap, it's going to be much better soon. number of feature is also very limited comparing to subeclipse.

It has support for most Major IDEs and NetBeans integration is under development, no idea when it will be released.

More information here IDEIntegration - Bazaar Version Control

Mercurial

Mercurial is much better integrated with other applications, for example currently Netbeans does not support Bazaar.

Git

Idea, Eclipse, NetBeans. Don't know about the other options

 

Roadmap

All major DVCSs are under active development, which means that their roadmap plays an important role in the decision.

Bazaar

Bazaar roadmap And also it looks like that bazaar developers really care about their users ThreeWishes - Bazaar Version Control , Bazaar also has Bazaar Performance Roadmap

Plugins

Bazaar

Bazaar like the other three supports plugins , in my experience installing Bazaar plugins is as easy as downloading and then extracting it into the plugins folder. That's it. it's even easier on windows.

Notes

There is a nice website for comparing git vs others, very useful. Funny thing is that HG users did the same! but made their point quite clear! Also Git users made another one for Bazaar!

There is also another website for comparing Bazaar and Git , they approach is interesting and it's based on personal experience using Tweeter! http://www.bzrvsgit.com/

Conclusions

In this part you can read the main reasons that people use particular VCS

Bazaar

Author : I decided to start with Bazaar for several reasons

  • It's written with python like mercurial and for this reason it's much easier to extend and develop than C or C++.
  • It's a multi purpose VCS covering several different Use Cases (Workflows)
  • It's plugin system is quite easy to use (With no compiling or building process)
  • It comes with several great cross platform GUI utilities
  • It might have a great future

Alfred :

Why not bazaar?
The first taste: create a new repo.
What kind of repo would you like?
Which branching model will you be using?
I really don't care much, just give me a new empty repo and let me
start working.
I'll branch whatever/however I want, and if later I regret, then I'll
be able to convert/rebase/transplant it preserving history logs.

I think Bazaar has great opportunities to become the best one in the future
(except I totally disagree with their branches' workflows, which is very rigid and annoying, resembled me the sort of inflexibility of CVS/SVN)

Git

Author : Why not Git? Well, although most git users are very passionate about their favorite VCS but it seems that many of them haven't even heard of/tried other ones. The fact that Linus has written it or it has been used for Linux Kernel might be main reason people like using it.

There is two reason that i don't like git, first it does not track folders! and the second it's written by C. I'm totally against using C for everything.

BTW it has awesome merge functionality which is expected since it's been originally developed for Linux Kernel which is all about merging!

Mercurial

Alfred :

Another point that hg wins over Git and Bazaar: easy to learn and use. Definitely hg help is not so short in vain. Enabling extensions would bring more advanced help. But that short basic help is enough to start and to handle any type of workflow.

Final words

So why do I hate git? | drupal4hu

The great thing about git is it gives you all the configurability and flexibility of Sendmail. The downside to git is that it gives you all the configurability and flexibility of Sendmail.

Alfred :

Outstanding points were:
- GUI: Hg
- History model: Hg
- Network Protocols: Bzr, Git
- Programming Language: Bzr, Hg
which makes me think that Bazaar has great opportunities to become the best one in the future
(except I totally disagree with their branches' workflows, which is very rigid and annoying, resembled me the sort of inflexibility of CVS/SVN)

They all born at the same time
Performance shouldn't be compared in terms of time per operations, since they are written in different programming languages and what matters is their algorithms' complexity order, since all of them will have performace optimizations in time
- C/C++ is great, but the future is beyond, OOP paradigms makes code more maintainable and reliable (despite slower), therefore I go for Python/Java
- I love Pear, but extensibility, reusability, and therefore reliability is for programming languages of the new era (C & C++ are also medieval)
Programming Language:
- Git is written in C/C++, Perl, bash scripts: -1
- Hg is written in C, Lisp, Python: +1
- Bazaar is written in C, Python: ++1
 
History model:
- Git: Snapshot: -1
- Hg: Changeset/Snapshot: ++1
- Bazaar: Snapshot: -1
 
Network protocols:
- Git: several: +1
- Hg: limited: -1
- Bazaar: several: ++1
 
Tracking directories:
- Bazaar: yes: +1
- Git & Hg: no: -1 (but Mercurial's documentation states well founded arguments for this)

News

More and more software and developers are migrating to DVCSs, here you can read their favorite DVCSs

Resources

Your rating: None Average: 2.4 (45 votes)