Re:How to Write a Git Commit Message
by JoshTriplett on Sunday September 13, 2015 @09:53PM
(#10213377)
> So it gets unpractical to write something like "fix the window that didn't close at the click of the button".
Imperative style normally produces more direct messages than that; talk about how it behaves now, not how it used to:
"Close window when button clicked"
Or, assuming "button" here means "close button":
"Close window when user clicks close button"
Yeah, plus, the fact that you fix something is the "why" part of your commit message, it should go in the body. The result could look like this :
> Reduce overlaying div element width > > This caused a bug on some devices : the div would overlay the close button, causing it to be unreachable.
I think that commit message that begin with "fix" are often not very good. Basically, you're saying "It was broken, this commit fixes it", not what was broken nor how your commit is supposed to fix it (yeah because sometimes, people think they are fixing something and actually create another bug in another part of the thing).
> Use the imperative mood in the subject line
Sometimes, you don't have or don't want to link to a bug tracker bug. So it gets unpractical to write something like "fix the window that didn't close at the click of the button". It would be much better to write "Fix: button click did not close the window". This is even more true if you have to write commits in a latin language.
I guess the bottom rule is synthesis and assertiveness should be only considered as a preferred method, not an hard rule.