Friday, June 27, 2008

Why Bazaar?

Bazaar is an open source, distributed version control system. It's similar to git, mercurial, svk, etc. There is a lot of info on it at the Bazaar site. Plus more reasons to use it on their Wiki.

I choose Bazaar because in my opinion it has the simplest/friendliest interface of the distributed version control systems. It also has the most powerful renaming support that I am aware of, including true directory renaming. The other version control systems, distributed or not, all have major problems with renaming directories. Hopefully this means we can be a little more experimental with project organization, and if we come up with a different approach we aren't dead in the water.

Other than that, it is similar to the other distributed version control systems. If any of you are unfamiliar with the benefits of distributed version control:



From my perspective there are three major advantages of distributed version control over a centralized system like cvs, svn, sourcesafe, clearcase, etc.

Work Without The Network
The first is distributed version control allows you to work when you're disconnected. I personally got into distributed version control when I used to ride the train for an hour and a half each way to work everyday, and I wanted to work on the train. You don't have to save up one huge commit for when you get a network connection, you can commit early and commit often whenever you want. Along with full rollback, diff, and branching support. When you want to share your changes, you push them to a server.

Private Branches
The second major benefit in my opinion is that you can create personal and private branches. I always think it's better to explain programming concepts using actual code. Being able to make a private branch of a project AND still be able to do commits, merges, diffs, etc., allows me to test my ideas before involving other people or muddying up a central source repository. With a centralized system, you would have to make a branch that everyone can see, and you have to worry about naming conflicts, muddying up the source history, and explaining why you're trying some approach. Or you can choose not to commit at all, which has it's share of problems and anxiety because you can't make major changes with a safety net anymore.

Real Branching/Merging Support
The third benefit is that you can't have distributed version control without first class branching support and being able to branch at will has plenty of benefits. The way I work with bazaar is I make a branch for every new feature or set of features I'm working on. Especially in a small group environment, you can never really work on only one feature at a time. I could be working on the networking code with a broken build, and alex asks me to make a quick UI change so they can have something new to demo to a potential investor. All I need to do in that case is make a new branch of the clean/working branch and make the change. And since it's all handled by the version control system, i can then merge that change into all the in progress branches without having to think. Centralized version control systems typically leave branch and merge support as an afterthought. In your typical centralized version control system, making a branch is a big event that must be recorded and managed and has all the issues that I mentioned about private branches.

1 comment:

Anonymous said...

Hi Phil, Do you know if you can checkout and work on just a part of the project tree with Bazaar, in the case of a large project? Or do you have to check out the whole project?