-
Notifications
You must be signed in to change notification settings - Fork 17.7k
CommitMessage
Commit messages, also known as CL (changelist) descriptions, for Go repos should be formatted as follows:
net/http: frob the quux before blarfing
Fixes #nnnn
Notably,
- the package name goes before the colon
- the part after the colon uses the verb tense + phrase that completes the blank in, "This change modifies Go to ___________"
- lowercase verb after the colon
- no trailing period
- keep the subject (first line) as short as possible. ideally under 76 characters or shorter.
- keep the body wrapped too, also max 76, unless it's really needed (ASCII art, table, or long link)
- no Markdown
- we do not use
Signed-off-by
lines in Go. Please don't add them. Our Gerrit server & GitHub bots enforce CLA compliance instead.
If it's not a complete fix and more is coming, use:
Updates #nnn
... instead of Fixes
. Don't use the other GitHub-supported verbs.
For non-"go" repos ("crypto", "tools", "net", etc), the subject is still the name of the package, but you need to fully-qualify the issue number with the GitHub org/repo syntax:
cipher/rot13: add new super secure cipher
Fixes golang/go#1234
Notably, the first line subject should not contain the x/crypto/
prefix. We only do that for the issue tracker.
- Please heed my plea and write good CL descriptions for Go—and for any other project you work on.
- The CL description is a public document that explains to the future what has been done and why.
If you're using GitHub Pull Requests, your commit message is constructed by GerritBot based on your PR's title & description. See https://github.com/golang/go/wiki/GerritBot#how-does-gerritbot-determine-the-final-commit-message
If somebody asks you to modify your commit message, you'll need to modify your PR.