Imperative Git commit messages in the active tense or mood

How do you write imperative tense commit messages?

According to the pundits, developers should write Git commit messages 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 flows naturally after these words:

If applied this Git commit message will...

An imperative tense example

Ask yourself: which of the following three Git commit messages is written in the imperative mood?  If applied this Git commit message will…

  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.

Except, I personally think the directive to write active-tense imperative Git commit messages is complete bunk. Here’s why.

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?

The imperative mood is just not a natural way to think of the work you’ve completed. If you are writing a Git commit message, you’ve 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 is by definition 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. The software developers I most admire, who work 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?

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 doesn’t dictate imperative terms, then I say your Git commit message should describe what you’ve done, not what it’ll do if it’s applied. 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