git

Adding Ticket Numbers to Git Commit Messages

We are using Redmine for tracking our programming tasks in my current project. Like most other ticketing systems, it has the ability to link commits in your source code repositories to a ticket when the commit message refers the ticket number.

1
2
3
Changes foo to bar because of baz.

refs #1234

I became tired of adding the ticket number manually to each commit message. Fortunately, git can add the number by itself with the help of a little hook and a naming convention for your feature branches.

Your feature branch name should include the ticket number like so: ticket-1234-awesome-feature

Now create the file .git/hooks/commit-msg in your local repository with the following content:

1
2
3
4
5
6
#!/bin/sh

ticket=$(git symbolic-ref HEAD | awk -F- '/ticket-/ {print $2}')
if [ -n "$ticket" ]; then
  echo "\nrefs #$ticket" >> $1
fi

This extracts the ticket number from the branch name. The ticket number is then appended to your commit message on each commit when git executes the hook.

Using Vaadin 7 With Clojure

There are some good examples on how to compose a web application with Clojure and Vaadin < 7. However, the web application bootstrapping process has changed for Vaadin 7. In this post I will show you how to create a Clojure/Vaadin 7 web application.

Read more …

ASIHTTPRequest and ARC

I wanted to use ASIHTTPRequest in one of my OS X projects. My project is ARC enabled. ASIHTTPRequest does not support ARC. One solution would be to add all the .h and .m files from ASIHTTPRequest to your project and set the -fno-objc-arc flag for each .m file.

Read more …