For example, instead of “Fix wrong default font for FooComponent on BarPlatform”, write “Explicitly inherit BazComponent font for FooComponent on BarPlatform”. Or instead of “Optimise FooFunction memory use to improve performance”, write “Reuse existing heap allocations on BarObject in FooFunction”.
On the one hand, I can see that writing summaries this other way communicates more specific detail about what changed; “Fix This is probably more of a ‘spaces versus tabs’ kind of thing where the answer doesn’t matter too much, but I am curious to hear from others on which approach you have found most beneficial in your work. In particular, if anyone uses this style of “describe the change” summarisation, have you experienced any particular benefits that might not be obvious? Thanks!
Yes.
Intent first, then a high level summary of the changes (if non-trivial).
Some programmers say that the code is the documentation and that comments in code are a "code smell". I strongly disagree.
The code is a communication between the programmer and the compiler, and leaves out intent. The code does what it does, right or wrong. But what we care about is what we intended the code to do, and why.
So intent is more important because the code could be wrong.
For me, the most likely context is through blame or similar - I am looking at some code, and trying to understand its history. I see who changed it, when - and their commit message. In which case, only the intent is useful - I already likely know what the change does.
The "what it does" form is more useful if for some reason you're scanning commits trying to find the one that introduced some particular change. But that's not a use case I ever encounter.
The reality is if the intent, other options, relevant notes etc are not valuable then they will be lost to time (no loss). If they are valuable where else are you going to put them? Some wiki or knowledge store for your project? How will you know that this specific commit and that (probably) sparse text in said knowledge store are related? Why not just put them together where they belong anyway.
Commit messages are not valuable when they are maximally short. They are valuable when they describe the changes the commit applies and ANY other relevant information for people (including the author(s)) in the future so that said people can understand the commits effect and other relevant information.
For an example of amazing commit messages look at PostgreSQL’s. They are sometimes long with the changes, notes, intent etc and sometimes short.
git commit -m "procaffeinating."
git commit -m "fixed the bug that made me question my life"
git commit -m "Felt cute, might delete later"
git commit -m "embracing insomnia ..."
Pull requests, on the other hand, have an explanation/justification for the change and a summary of changes.