The Post-Commit Hook

Out Of Date Warning

Languages change. Perspectives are different. Ideas move on. This article was published on August 17, 2008 which is more than two years ago. It may be out of date. You should verify that technical information in this article is still current before relying upon it for your own purposes.

One of the least discussed features of Subversion is the post-commit hook, or really any of the built-in hooks that Subversion offers. These hooks are executed at a variety of different times, and the one I’m focusing on is the one that is executed just after you commit changes to the repository.

Keith Casey mentioned to me one day that he could turn on “commit messages” and I inquired as to what this was. He explained that he could have Subversion mail him every time someone committed to a repository. Being someone who works with others, I thought I’d give it a shot.

Implementing the feature was actually not as hard as I thought it might be. I wrote a short script that simply got the last log entry (in verbose mode) and e-mailed it to myself with a nice wrapper. I also set it up to e-mail a member of my team. So far it looks promising; we’ll see if I need to tweak it as time goes on.

As someone who likes user-friendly design, subversion never ceases to please me with its elegance and simplicity, yet its seemingly endless power.

Write better object oriented PHP today.

Object oriented programming always leaves you with a headache. What if you could master it instead?

Get the book now! »

There are currently no comments.