A few years ago I became sold on distributed source control. Being able to do offline work, try out new ideas cheaply, and throw them away, all were great things. I started with mercurial, but over the summer started using git. A couple of things pushed me over the edge.
- git appeared more modular, at the end of the day this wasn’t really true. The lack of a libgit was actually very disappointing (especially after I had sworn there was one), as I’ve got a number of interesting ideas stalled behind that one.
- the git-svn pluggin, which provides really good 2 way integration between svn and git trees. I’ve stopped making anon svn clones, I now do a git-svn clone. If I want to fix something locally, I can now version that fix.
- github – free social hosting of git trees
Github helps you over the hump in publicly hosting git trees. Honestly, the hump isn’t very high, but the documentation out there could be a bit more straight forward. I’d been chugging along using github for all my random open source projects, some that are active, some which are stalled. But the source code is out there for others to take a look at. Github provides nice instructions for people to clone the work, and run with it. It’s definitely a prettier interface.
Github really started to shine for me this past weekend though. I was looking for ical generation code for ruby to replace an email tool that I wrote in perl for our MHVLUG monthly meeting emails. There exists 2 ruby ical projects, vpim and icalendar, neither of which support timezones in the ical generation, and both with pretty inactive mailing lists. Once it became clear that the problem was not solved, I decided to dig in and see if I could come up with something workable.
But once you go social, github really shines
There had been a post on the icalendar devel list a few months back that said he had fixed a couple of timezone issues and provided a github url. I cloned that project, and realized that while it got closer to what I needed, it still didn’t quite do what I needed. So I clicked the fork button.
I was now given my own fork of the icalendar source. But more importantly, it also showed me all the other forks on github, which there were 5 others. I made my fixes, pushed them back public, and then proceeded to start to accumulate up some of the other changes out there. There is even a fork queue which shows all the outstanding changes in other forks out there, as well as odds on whether or not the patches will apply.
While you could figure all this out on your own with the command line, that kind of discovery and view is really a help and a timesaver.
And it’s even better if you are doing ruby
Github is written in ruby, though I’m not sure on the framework behind it. As an added bonus to people hosting ruby code on the site, the team created a gem build service into github. You add a specially formatted gem spec file to your github tree, and you’ll get a gem built on each checkin. My 2 ruby libraries that are there now are configured to build gems, easy for all to install.
If you haven’t checked out git, or github, you should. While I found the learning curve on git to be higher than I really wanted to deal with, the community is very active, and the number of things that support git now is quite high. Rails generators even support git now, automatically source managing via git or svn if you ask them to. Github popped out of no where in 2008, and I can’t wait to see where they are going to go in 2009.