Commit messages (check-in comments) are a very important part of the software development process. Source control keeps track of all changes to a file, but we need good commit messages to understand the intention behind a particular change to a file. Anders Sandvig has a good overview of how to write good commit messages in this blog post.
I remember explaining to a junior developer that when he checks in his code, he should write a comment describing what he was doing. He looked at me like I was an idiot and proceeded to commit with the following message:
Checking stuff in
Okay, that was my fault….I should have been more clear. I rephrased my instructions: “When you check in your code, write a comment that describes the change you made to the code.” The new instructions made a lot more sense to him and his comments improved over time.
Today, I was reviewing the commit history for Entity Framework 6 (http://entityframework.codeplex.com/SourceControl/list/changesets). I can’t remember exactly why I was there because I very quickly found myself laughing while reading through the commit messages. Apparently the EF team is staffed with comedians. Their commit messages start with a short joke, then proceed to explain the change like any good commit message would.
Here are a few of my favorites:
I like this approach. Start with a short joke, then explain the change. I think that humor in the workplace helps to keep us sane. Let’s face it: Our jobs can be very frustrating at times. Chances are if you are looking at the version history for a file, you hare having ‘one of those days’. Seeing a commit messages that makes you chuckle will probably improve your mood. Until TFS and Git allow us to attach pictures of kittens to our commits, humour is our only option.
Challenge yourself to insert some humor into your next commit messages. When all else fails….whatthecommit.com