The most important part of a commit message is the context.
Good enough commit log:
utils: Minor
drivers: Fix
assets: Update
docs: Typo
Hopeless commit log: Minor
Fix
Update
Typo
Context should answer the "what". Think of it as the one word you tell a new conversation participant to let them realize what you are talking about. drivers: Fix
Let's say your fix causes issues later. When I read the commit message, I want to understand what you were trying to fix so I don't accidentally re-introduce the problem when I fix your fixExplain the issue, and by all means mention the bug number, but you must explain the issue you are dealing with.
Point is bad commit messages are sometimes a symptom to a larger problem and as with this vendor it is often a process problem, not an individual developer problem. In my opinion, the main problem here is that management simply doesn't care she it doesn't empower leads and developers who should care.
> Although I tend to have a short summary and mention the ticket number.
So for example
XJ-8883 - Ensure DB connections are closed sooner in main poolExample:
EntityStore build method records the specifier argument when given
Article about it: https://github.com/aaronjensen/software-development/blob/mas...
My analogy is your bookshelf books still need jackets!
As for "spacing", you can probably tell the why from the diff as well. The "what", however, tells you whether it's even worth opening the diff.
But yes, even minor changes should have a descriptive commit message that summarises the change in order to make commit history useful.
Now, when the code itself needs an explanation then that should be in the form of a comment next to the code itself.
But, I think the value of commit messages become really apparent once you (or your team) are relying on other visualizations of commit messages like `blame` and `bisect`
Tracking down the introduction of a bug with bisect and resolving to a commit whose message in “minor”, because the person in the past didn’t think this change was important enough to describe intent can quite the temporal foot-gun.
Even for the most minor commits, including "improve comment formatting ; utils.pl" allows skimming that message and comparing it to the actual commit.
It also helps me be aware of what I'm doing, pointing and calling style.
That said, an "utils" file is often a smell in code organization.
Contra: while this is true, it's worth considering how 'information about which files are effected' scales when examining the history of a repo. A commit message that simplifies and clarifies the intent is more useful than one that requires a future reader to read each git commit in full to understand the effect.
Right, but this is not always the same as the files which I intended to be affected, and the matching of the two is the sanity check here.
utils was just an example filename.
I want to slightly disagree on this for folks who are early on in career e.g me; I think there is a lot of value in learning to communicate precisely and having a habit of writing good commit message has certainly improved my skills, both verbal and written.
Even though, this activity appears futile for a minor change; it might help to improve other skills :)