News for hackers. Stuff that matters.
Re:Atom – Git commit messages by davexunit on Monday January 12, 2015 @10:53AM (#8874514)
>the number one rule of commit messages in my book is explaining WHY the commit exists

The commit message should say what changed, not why. Comments are for explaining why the code does what it does.

Good commit log: http://git.savannah.gnu.org/cgit/guix.git/commit/?id=fb519bd...

Re:Atom – Git commit messages by pjc50 on Monday January 12, 2015 @11:11AM (#8874644)
The diff shows you what changed. The commit message is a comment on the diff and absolutely should say what it's for.

This enables you to easily compile release notes, for example.

Re:Atom – Git commit messages by davexunit on Monday January 12, 2015 @11:21AM (#8874700)
Yes, it should say what it's for, but it shouldn't need to explain itself any further. Sorry if I didn't make that clear. For example, if someone refactored something, the commit log can simply say "Factorize foo", it need not explain why they were refactoring in the first place.
Re:Atom – Git commit messages by qznc on Monday January 12, 2015 @11:01AM (#8874571)
Comments tell why the code does what it does. Commit messages tell why the code does something different than before.

Example comment: i++; // because server starts counting at 0 (not 1)

Example commit: Our customer switched to bar (from foo), which starts counting at 0 instead

Re:Atom – Git commit messages by nirvdrum on Monday January 12, 2015 @11:56AM (#8874902)
That works as long as you're adding code. But what about when you're deleting code? I absolutely want to know why you've removed something.