Migrating to Git

At work, we made the move from subversion to git as our version control tool. I used git for a few times before we migrate the whole project thanks to the git-svn bridge, and, apart from the usual headache when it comes to merging branches, I was rather convinced we would make the migration to git. To explain what branching model I was expecting to use, I dig the Internet for a good tool, hoping to migrate our so "1.0" Trac version control and issue management to a more github like one.

Founds

There is not as much tools as I first thought, I found gitorious, which seems to be a good tool, but it looks complicated to setup and lacks (or I didn't find it) a good graphical representation of the branches in the repository.
I came across gitlabhq, which is a starting project, but promising as it aims to mimic github in many ways. I've tried it and I must say I am very impressed, it is now one of the tool we use internally, it is not yet a perfect tool but it does its jobs very well. We still use our old Trac environment with git integration to hunt down our bugs and control ticket workflow with commit messages (blog post to come). We also use Trac's wiki to write our internal documentation toward developpers.

Apple silently announced their future release of Mac OS X operating system to come this summer (2012). The pages on Apple website show the new features and claim this release is the missing bridge between the iPad and the Macs, I think it narrows the gap between their two OSes even more than they claim, I fear a completely bound to Application Store operating system requiring jailbreak to be free in OS X 10.9...

At work we faced a strange issue with mongoDB 2.x. Whereas our requests were working perfectly with mongoDB 1.8 we always got errors. The message mongoDB was firing at us was of the form :

Caused by: com.mongodb.MongoException: assertion db/../bson/bsonobjbuilder.h:127
       at com.mongodb.MongoException.parse(MongoException.java:82)

I found the following issue in mongoDB's Jira but apparently nothing to do with our requests (we are not using empty properties indexes), it takes me a lot of time to figure out that, at times, our request were sorted on empty properties (as stated here). The fix is really simple, do not sort on empty properties !

As it takes me times to find this and I did not find any blog post explaining this, I hope it will help another developer.

This morning one of the Jenkins job went red, 5 tests were failing, and it was very difficult to find out which commit caused the break (69 commits were concerned), I used git bisect to run maven tests to find the guilty one. Here is a quick howto:

  • find a stable commit (in my case it was 2ea34cf09cc83804cdcc445476bfb597c617a034)
  • write a short script (myScript.sh) allowing you to run the tests:
#!/bin/sh
mvn -f path/to/my/pom.xml -Dtest=MyTestClass test
  • git bisect start HEAD 2ea34cf09cc83804cdcc445476bfb597c617a034
  • git bisect run ./myScript.sh

That's all, in a few runs (6 in my cases), git found out the commit causing the test failure, a simple git revert and tests were back to green !