Hacker News new | ask | show | jobs
by TrainedMonkey 506 days ago
Yes, when spelunking why something has changed having good rationality would be a godsend... however let's face reality:

1. Majority of commit messages are low quality and would benefit significantly from a good summary of what was done.

2. Margin of commit messages is often too small for documenting the rationale - this job is better left for tickets.

3 comments

> 2. Margin of commit messages is often too small for documenting the rationale - this job is better left for tickets.

The commit message lives with the code. The number of times in my career that a company has migrated, changed, consolidated, or otherwise made all those links in commit messages obsolete, well I don't quite yet need two hands. But I see a lot of dead ends to context in code bases.

Nothing stopping someone from deciding to migrate VCSs (or even just repos) and all of a sudden end up in the place that 15 years of codebase history is squashed down to a single new starting commit. :(
Don’t forget that most modern version control systems are distributed. The same can not be said for ticketing systems.
If the content of the commit is too small to be meaningful, the commit is too small. Either wait until you’ve done more before committing, or rebase -i before pushing your branch and merge up any piecemeal commits into better sized ones that communicate a story.

Keeping that metadata in tickets means that it can’t be read within ‘git blame’. It’s also all too easy for it to be lost entirely when changing ticketing systems, transferring codebases between teams or companies, etc.

> Majority of commit messages are low quality and would benefit significantly from a good summary of what was done.

Why? At that point doesn't the diff speak for itself?

Not to mention, the best commit messages are about the code that isn’t there.

As you say, we know what’s there. I need the author to tell me why it’s there, and perhaps what other alternatives were abandoned because they didn’t work.

You know, so I don’t waste a day finding out for myself why you didn’t just do ${obvious}.