Monday, March 26, 2012

git and why I sometimes feel lost

Yes, I had an affair with cvs, svn and Perforce the last couple of years! But most of the time I'm using Perforce, since this is used by my employer. Last year I started to look closer at git and mercurial. For some open source projects that I'm contributing to, I had to use git (Jenkins and homebrew) and mercurial (tamarin) to keep track of my changes. Having used Version Control Systems (VCS) for a long time, I thought that git and mercurial (hg) are just another new system that couldn't be too difficult to deal with. The start wasn't that bad: clone a repo, work locally, submitting changes locally without connection to the repository server is really a very productive feature.

How does it work if you meet somebody new and you try to build a relationship? You look for similarities and things that make it easier to find common ground. I my case I was still thinking: hey, they are all VCS's (Version Control Systems). That's true, they have a lot in common, but I also think they are more different than everybody thinks. I had to learn new concepts (which I always consider good) because of the centralized/decentralized nature of the different systems. The different terminology that all the systems use, is one of the issues that makes working not as smooth as I was used to it. Why? Every time I run into issues with branches, merges, resolving and I had to search for the "thing or situation" that described my situation best. But always in the language of the VCS that I was currently using. The longer I use the system, the better I should get to find the appropriate information quickly next time. I found numerous community driven site with tips and tricks and work flows for git and mercurial. There is the git and the mercurial handbook which will provide enough information to manage the most complex work- flows one can think of. But sometimes I'm looking for the simple tasks and how to manage them.

I'm getting better. I like git and hg. I don't love them yet, but we are working on our relationship. Even if they sometimes give me a hard time solving simple tasks, like this one: I wanted to delete a branch in one of my github repositories. As an example: in Perforce GUI tool I select the branch and delete it. Done. With git I had to do this in order to delete the branch:
git push git@github:ingorichter/homebrew.git :update-libzip
A push really deleted the branch. Perfect!? I hope I remember the command for the next time if I need to do it again.

Don't get me wrong: git and hg are very powerful, but it takes some time until your brain embraces the massive power of these VCS's. Until then, I assume that I will feel lost from time to time.

An IMHO very interesting podcast about VCS's can be found here.

Friday, March 9, 2012

Jenkins: OSX installer now supports the creation of it's own jenkins user

Okay, this doesn't sound like big thing, but there were some valid complaints from users that used jenkins to run their iOS and maven builds. Some of them had trouble with ssh. See https://ljnelson.posterous.com/getting-jenkins-running-on-a-mac and http://colonelpanic.net/2011/06/jenkins-on-mac-os-x-git-w-ssh-public-key.

Since jenkins version 1.449, the OSX installer provides an option to run the jenkins service no longer as daemon user. The installer is able to create a new jenkins user with it's own home directory (maven and ssh, here we come!). It should be easier to grant the jenkins user access to the keychain to allow codesigning of iOS deliverables.

Some facts about the new jenkins user:
  • uid will be determined automatically to avoid any collisions with existing users
  • guid of jenkins group is determined automatically to avoid collisions with existing groups
  • home directory of the jenkins user will be /Users/Shared/Jenkins
Installer options


How to get rid of the jenkins installation?
I heard people talking about issues with the installer updating an existing installation (how can this be?). Some of them asked for way to get rid of the installed files. Since OSX doesn't have a mechanism to un-install files, there are only the options to remove the files manually or use some 3rd party tool (TrashMe) to get rid of the files. Since these tools use some heuristic methods to determine the files to remove, I created a simple shell script to remove all files installed by the installer. The script can be found here.
Warning: I used the script for testing purpose when experimenting with the installer. The are no error checks and it's far from being perfect. So, please use at your own risk!