Sparrow moves to GitHub

Daniel Sperl on January 28, 2011

To this date, you could get the Sparrow source code by accessing a subversion repository on our own server. Subversion is great, and I enjoyed working with it.

(BTW, I recommend using a version control system to everyone, even if you are working alone. It’s just like having an “Unlimited Undo” for all your source code, which is just priceless!)

Why move to Git?

Nevertheless, I had heard great stories about the new kid in town, git, and several forum members urged me to have a closer look at it. Git is a distributed version control system, which means that every user has a copy of the repository available offline, including the complete history. That alone is a cool feature, but what I found even more intriguing is the way git handles branches.

Other VCS have branches as well, but most of the time, they are a pain to work with, and they are used only infrequently. Git, on the other hand, encourages you to create branches even for small things, e.g. when experimenting with a new feature or refactoring. And now that I’ve worked with that concept for a while, it starts to make sense. Having those branches locally makes it easy to start different experiments with the source code, and switch between those experiments easily - without effecting the repository on the server.

As git was developed with the Linux Kernel in mind, it is perfectly suited for Open Source software. It makes it easy for developers to contribute code - e.g. by patches or so-called “pull requests”.

Another advantage of git is that there is an excellent hosting service available, and it’s even free for Open Source projects: GitHub. It offers a very intuitive, but powerful user-interface, allowing users to browse through and compare revisions and even start a discussion about specific lines of code of a commit. It also features a simple issue-tracker (replacing our internal Redmine installation).

All those advantages finally convinced me that git is a perfect fit for Sparrow. That’s why I transferred all the data from the Subversion repository to its new home at GitHub. Click on the URL below to got to Sparrow’s GitHub project page:

github.com/PrimaryFeather/Sparrow-Framework

The new Repository

The new repository contains two branches: “master” and “development”. The Master branch always points to the latest stable release - currently, it points to Sparrow 1.1. The development branch is where the constant development process is happening. It already contains several bugfixes and the first new features of Sparrow 1.2. If you follow the progress of that branch, you will always have the cutting edge version of Sparrow - in exchange for the risk that some of the new features might not be thoroughly tested.

Getting started with git

Of course, you don’t need to work with git at all. Just as before, we will always provide a zip-file containing the latest stable version. But if you want to use the development-version o f Sparrow, experiment with the new features - or just play around with git! - then here is a short introduction that shows you all you need to know to get started.

If you have already installed git on your system (I recommend using MacPorts to get it), you can clone the repository with the following command:

git clone git://github.com/PrimaryFeather/Sparrow-Framework.git

This downloads the repository and creates a copy of the “master” branch. To create a local copy of the “development” branch, enter the new directory and type:

git branch development origin/development

Now all is prepared: you can easily switch between “master” and “development” branch with the “checkout” command:

git checkout development # switch to development branch
git checkout master      # switch to master branch

You can update each branch separately. This is done with the “pull” command:

git pull # fetches the latest changes and merges 
         # them with the active local branch

The nice thing about pulling changes is that this merges the latest version of the source and your local changes; that makes it easy for you to experiment with the Sparrow source code yourself. If, however, you have made some local changes which you want to revert, you can do this with the following 2 commands:

git status # shows which files were changed
git checkout path/filename # reverts the changes of a certain file

If you want to use Sparrow’s git repository, this should be all you need to know to get started. To find out more about git, I can recommend a reasonably short tutorial that covers the basics of how to work with git: Git Reference.

Have fun!