===== Overview =====
What makes a good Git commit?
Links:
* [[https://gist.github.com/robertpainsi/b632364184e70900af4ab688decf6f53|Commit Message Guidelines]]
* [[https://wiki.openstack.org/wiki/GitCommitMessages|OpenStack advice]]
* [[https://chris.beams.io/posts/git-commit/|Chris Beams' advice]]
* [[https://stackoverflow.com/questions/15324900/standard-to-follow-when-writing-git-commit-messages|Stack Overflow advice]]
* [[https://www.slideshare.net/TarinGamberini/commit-messages-goodpractices|SlideShare presentation]]
Any other good ones?
===== Properties of a good Git commit (sort of subjective) =====
* Subject (first) line (followed by blank line):
* 60 char max (including subsystem name) for ''git log %%--%%oneline'').
8c7ae38d1ce1 afs: Fix StoreData op marshalling
7d6ab823d646 vfs: Update mount API docs
b6ffdf27f3d4 s390/cpumf: Fix warning from check_processor_id
01f2f5b82a2b SUNRPC: fix uninitialized variable warning
8c838f53e149 dpaa2-eth: fix race condition with bql frame accounting
047a013f8d0a chelsio: use BUG() instead of BUG_ON(1)
* Be //accurate//; the subject must describe the actual commit.
* Use the imperative mood ("Fix", "Adjust", "Correct").
* Don't capitalize the first word.
* No ending period.
* Is this changing functionality, or just fixing docs/comments.
* Commits themselves:
* Well-defined and modular, for future cherry picking or reverting.
* //Complete//; use ''git commit %%--%%amend'' to assure this.
* Commit messages:
* What is being changed, what functionality is being affected (if any).
* //Why// it is being changed.
* References to discussions about this commit (people, mailing lists).
* Level of testing this commit has had.
* Names of others who have ACKed/tested/reviewed this commit.
* References to bug tracker items (JIRA) this commit is addressing.
===== Some examples =====
==== U-Boot ====
$ git show --summary 6ff005cf19363382fc867d7876a75fd8a386e894
commit 6ff005cf19363382fc867d7876a75fd8a386e894
Author: Dave Prue
Date: Thu Aug 31 19:21:01 2017 +0200
sunxi: Fix CONFIG_SUNXI_GMAC references
SUNXI_GMAC was still used to configure the code where as the
same has been renamed and moved to Kconfig in below commit
"sunxi: Move SUNXI_GMAC to Kconfig"
(sha1: 4d43d065db3262f9a9918ba72457bf36dfb8e0bb)
Signed-off-by: Dave Prue
Reviewed-by: Simon Glass
Reviewed-by: Jagan Teki
Reviewed-by: Mark Kettenis
Tested-by: Mark Kettenis
[Tweek commit message, config_whitelist.txt, build-whitelist.sh]
Signed-off-by: Jagan Teki