5 ms·
Notes on Writing Good Commit Messages
- muyyatin 16y agoIs there any justification for preferring present tenses over past tenses? Past tense ("Fixed ...") makes more sense when looking at a report of what was done.
- crazydiamond 16y agoSeems to be a convention. I prefer past tense too.
- tung 16y agoIt makes a tiny bit more sense when the commits are patches. I don't mind the difference too much; if I'm in a team, I just go with what everybody else does.
- andreaja 16y agoThe code is alive and the code is hungry.
- tomstuart 16y agoThe most objective justification is that Git uses the present tense when it generates its own commit messages ("Merge branch...", "Revert..."), so using the same tense for your commit messages makes everything consistent.
- adolph 16y ago1. Using the past tense is a bit presumptuous on the part of the committer. 2. Using the same tense as the todo list reduces rewriting.
- donaq 16y agoAs long as it's clear and succinct, does this really matter?
- draebek 16y agoIn Git, at least, some commands expect the first line of the commit message to be meaningful and self-contained. For example, `git log --oneline`. Following the custom of making the first line a short summary makes some tools more useful. (Emphasis on "short": eighty column width windows are very common.)
- jakevoytko 16y agoIn addition to Git, "first line as a summary" appears in a few other places - for instance, Mercurial's 'log' command prints just the first line by default. Following the guidelines in this Gist helps future-proof your project history against other tools, and helps developers using your code with some conversion tool.
- davidmathers 16y agoTim Pope explains why it matters: http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html http://tbaggery.com/2008/04/19/a-note-about-git-commit-messa...
- mkramlich 16y agoanother rule about commit messages I find useful, esp if you have a multi-national team or a random revolving pool of remote contractors, is to require that they always be in English. Along with code comments and docs. i also sometime like to see a prefix indicating area like "GUI: blah" or "zfs: blah" so you can quickly categorize or get a sense for what area or subsystem was touched, if just looking at the messages and not the files changed.
- muyyatin 16y agoI've also found prefixing with the category extremely helpful, even for looking through my own commit logs.
- alagu 16y agoThe title should have the prefix "GIT only"