Written in the discussion about a pull request for Freenet [1].
When I look up a commit, I’m not searching for prose. I’m searching for short snippets of information I need. If they are long-winded explanations, I am unlikely to even read them.
To understand this, please imagine coming back home, getting off the bike and taking 15 minutes to look at the most recent pull-request. You know that you’ll need to start making dinner at 19:00, so there is no time to waste.
With long winded commit messages that plays out like this:
You look into the pull-request and the explanations are longer than the code changes. You can either read half the explanations or just look at the code. So you try to understand what the code does and what it intends to do from the code alone. After 15 minutes you post a partial review and start cooking. Next slot for code review is tomorrow evening, or maybe next friday. The pull-request lies open for several weeks while more changes pile up.
Contrast that with short commit messages:
You look into the pull-request. The commit message gives you the intention of the change (“sounds good”), maybe with a short note on non-obvious side-effects of the implementation, and you skim the code to see whether it realizes the intention. If it does and you don’t see problems which the writer might have overlooked: Great, code review finished. You write the review and go make dinner. The pull-request is merged the same week.
That’s why I’d suggest to just write short messages and put detailed explanations into a blog. If you like writing those explanations. That’s what you have a blog for, and you can search that later if you need these notes. If they are essential to understand effects of later changes, you might want to document them in a text file like HACKING or docs/devnotes.txt
.
The Linux kernel has nice examples of concise commit messages:
Note that the merge commit already almost looks like an entry into a NEWS file [4] using the Perl Changes Format [5]. (If NEWS files cause you merging pain, consider setting a union merge rule [6].)
Links:
[1] https://github.com/freenet/fred/pull/341
[2] https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=7a6cb0abe1aa63334f3ded6d2b6c8eca80e72302
[3] https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=0a68c6bc7ce9d4855f3130f9eff8ff774b597531
[4] https://www.gnu.org/prep/standards/html_node/NEWS-File.html
[5] https://metacpan.org/pod/distribution/CPAN-Changes/lib/CPAN/Changes/Spec.pod
[6] http://www.zwillingsstern.de/english/free-software/merge-news