Hacker News new | ask | show | jobs
by 0x457 101 days ago
Because commit history is here to explain WHAT and not WHY. "Why" is explained by a decision log such as ADR which can be store in the same repo and can be mutated in the same commit that has WHAT in its commit body.

But also, if you look at large projects like Linux or FreeBSD, commits there explain why as well.

2 comments

> Because commit history is here to explain WHAT and not WHY.

When that commit gets implicated by `git bisect` and all you see in the message is exactly what you’d see by reading the patch anyway, you’ll wish the author answered why they did what they did. This, especially, when the author is no longer at the company.

I disagree with this: commit messages should explain the Why. For the What, I can read the diff. Sadly, many commit messages are about the What.