Monday, 18 October 2010

The advantage of not being connected

There are normally a few articles published each week on version control, an odd "How-To" guide, a tale of how a version control system saved someone numerous hours worth of work or the odd rant.  Over the last few weeks however there seems to be a little more background noise when it comes to version control, more grumblings on the internet and a lot more where I work.

With my current employer we have numerous projects being worked on by teams internationally, but we don't seem to have any real consensus on which tool set to use.  This is fine for some of the work as we have client apps and web apps written in Java/.Net/C++, but a common version control system would be nice.  I've so far worked on applications where the code has been commited to CVS, SourceSafe and Subversion repositories, we also have Team Foundation Server (TFS) and a couple of others which I rarely remember around somewhere as well.  I know the people working on CVS complain that it's slow, SourceSafe users complain that it's ancient and unfit for purpose, the TFS guys complain that the system is unusable and the Subversion people actually tend to be quite happy.

There was one occasion however where non of them were happy and that was the day a virus hit the servers.  The infection itself wasn't that serious but the downtime was crippling while the network monkeys checked the servers and slowly bought them all back online.  Most people were able to continue working for a short while until they needed to check bits out or check them back in.  So I got a few odd looks when I was sat at my desk working away on some code, performing regular commits and relatively oblivious to the world around me.

As it happened I was in a lucky situation, first of all I was working on a new piece of code so had little reliance on others and secondly a few weeks earlier I had added another version control system into my tool set.  I had installed Bazaar and had worked it into my processes so that when I started a new piece of work I would use a local Bazaar repository, I would push this up onto a remote location every few commits and then when I was ready for everyone else to get their hands on it I would export it to a new location and commit it to the standard (which ever one it was that day) version control repository.

A number of times since it has proven invaluable to have a local repository, for instance I have a folder where I keep all my snippets and tests, these are all version controlled using Bazaar and again I push them to a remote location every once in a while.  Sometimes I will remove folders and files just to keep it tidy and relevant but on the odd occasion I will need to go back in time to some folder where I had worked on something which I would be in need of again.  If I've deleted it then I can restore it, get the information I need and if I feel the need delete it again.

Not having to rely on a central repository has been a life-saver on numerous occasions, a few people have also gotten wind of what I'm doing and are investigating switching newer projects over to a distributed version control system to avoid the kind of downtime I mentioned earlier.  Naturally there are a few doubters, some of whom still aren't convinced by version control itself, but they're the ones who'll be losing their hear quicker when it all goes wrong.