Imperative Git commit messages in the active tense or mood

How do you write imperative tense commit messages?

According to the pundits, Git commit messages should be written in the imperative mood.

Without going into a long discussion about what the active voice is and what it means to speak in the imperative mood, we can simply say that an imperative Git commit message will flow naturally after the words:

If applied this Git commit message will...

An imperative tense example

Given that preamble, just ask yourself which of the following three Git commit messages is written in the imperative mood:

  1. Fixed the buffer overflow issue
  2. Fixing the buffer overflow issue
  3. Fix the buffer overflow issue

If you selected option 3, then you’ve mastered the imperative mood. You now know how to write an imperative Git commit message. However…

active tense git commit messages

Members of the Angular project are good at respecting the imperative mood in their Git commit messages.

Should Git commit messages be past tense?

Personally, I think the directive to write imperative Git commit messages in the active tense is complete bunk.

The imperative mood is just not a natural way to think of the work you’ve completed, and if you are writing a Git commit message, you have completed your work. You write commit messages after you’ve written your code, not before. A Git commit message that discusses what was done, which would put it in the past tense, makes far more sense to me.

Furthermore, it’s not what I typically see when I sift through commits on open-source projects. It appears to me that the software developers I most admire, who are working on the most innovative products, aren’t particularly diligent about observing the imperative mood requirement with their Git commit messages. If they’re not captured by the concept, why should I be?

And finally, the imperative directive is rather ethnocentric. Not all languages flow like English does, so pushing a syntax based on the Queen’s English down everyone’s throat just doesn’t seem right to me.

imperative git commit message

Is this a good git commit message or a bad one?

Git commit message standards

One of my favorite sayings is, “There are no right answers, there are only wrong answers. If you’re not wrong, you’re good.”

There are certainly Git commit message standards and best practices, but the correct guidelines and conventions you should follow are the ones decided upon by your team.

If your team says every Git commit must be in the active voice or the imperative mood, then that’s the guidance you have to follow. Not doing so means you’re doing something wrong, and that’s not right.

On the other hand, if your team isn’t dictating imperative terms, then I say your Git commit message should describe what you’ve done, not what it’ll do if it’s applied. As far as I’m concerned, imperative Git commit messages make commits in your Git repo harder to sift through, and that’s the last thing you need when you’re tracking down a bug or trying to find the source of a fatal error.

 

App Architecture
Software Quality
Cloud Computing
Security
SearchAWS
Close