blob: ad181639cf6a7edfe81017ccec626584c61b2f9f [file] [log] [blame] [view]
Brad Fitzpatrickd3445692018-02-09 12:24:36 -08001# Commit messages
2
Mikio Hara0e0a6732018-02-10 08:12:03 +09003Commit messages, also known as CL (changelist) descriptions, for Go repos should be formatted as follows:
Brad Fitzpatrickd3445692018-02-09 12:24:36 -08004
5```
6net/http: frob the quux before blarfing
7
8Fixes #nnnn
9```
10
11Notably,
12
13* the package name goes before the colon
14* the part after the colon uses the verb tense + phrase that completes the blank in, *"This change modifies Go to ___________"*
15* lowercase verb after the colon
16* no trailing period
Brad Fitzpatrickc1534fe2018-02-09 12:26:49 -080017* keep the subject (first line) as short as possible. ideally under 76 characters or shorter.
18* keep the body wrapped too, also max 76, unless it's really needed (ASCII art, table, or long link)
Andrew Bonventre7ae4c552018-03-05 11:46:06 -050019* the Fixes/Updates line should be after the body with a blank newline separating the two
Brad Fitzpatrickc1534fe2018-02-09 12:26:49 -080020* no Markdown
Brad Fitzpatricka9bd54c2018-02-15 07:58:36 -080021* we **do not** use `Signed-off-by` lines in Go. Please don't add them. Our Gerrit server & GitHub bots enforce CLA compliance instead.
Brad Fitzpatrickd3445692018-02-09 12:24:36 -080022
23If it's not a complete fix and more is coming, use:
24
25```
26Updates #nnn
27```
28
29... instead of `Fixes`. Don't use the other GitHub-supported verbs.
30
31# Other repos
32
33For 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:
34
35```
36cipher/rot13: add new super secure cipher
37
38Fixes golang/go#1234
39````
Brad Fitzpatrickc1534fe2018-02-09 12:26:49 -080040
41Notably, the first line subject should **not** contain the `x/crypto/` prefix. We only do that for the issue tracker.
42
Mikio Hara0e0a6732018-02-10 08:12:03 +090043# Non-normative references
44
45- [Please heed my plea and write good CL descriptions for Go—and for any other project you work on.](https://groups.google.com/d/msg/golang-dev/6M4dmZWpFaI/SyU5Sl4zZLYJ)
46- [The CL description is a public document that explains to the future what has been done and why.](https://groups.google.com/d/msg/golang-dev/s07ZUR8ZDHo/i-rIsknbAwAJ)
47
Brad Fitzpatrick7ca29b12018-02-13 13:32:59 -080048# GitHub Pull Requests
49
50If you're using GitHub Pull Requests, your commit message is constructed by GerritBot based on your
51PR's title & description. See https://github.com/golang/go/wiki/GerritBot#how-does-gerritbot-determine-the-final-commit-message
52
53If somebody asks you to modify your commit message, you'll need to modify your PR.