Skip to content

Commit 2b6e588

Browse files
bf4MylesBorins
authored andcommitted
doc: make commit guidelines easier to reference
- Can now link to 'Commit Guidelines' from pull requests - Breaks up commit requirements and recommendations PR-URL: #11732 Refs: #11723 (comment) Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
1 parent b53d172 commit 2b6e588

File tree

1 file changed

+20
-23
lines changed

1 file changed

+20
-23
lines changed

CONTRIBUTING.md

+20-23
Original file line numberDiff line numberDiff line change
@@ -98,15 +98,28 @@ $ git commit
9898
Writing good commit logs is important. A commit log should describe what
9999
changed and why. Follow these guidelines when writing one:
100100

101-
1. The first line should be 50 characters or less and contain a short
102-
description of the change. All words in the description should be in
103-
lowercase with the exception of proper nouns, acronyms, and the ones that
104-
refer to code, like function/variable names. The description should
105-
be prefixed with the name of the changed subsystem and start with an
106-
imperative verb. Example: "net: add localAddress and localPort
107-
to Socket"
101+
1. The first line should:
102+
- contain a short description of the change
103+
- be 50 characters or less
104+
- be entirely in lowercase with the exception of proper nouns, acronyms, and
105+
the words that refer to code, like function/variable names
106+
- be prefixed with the name of the changed subsystem and start with an
107+
imperative verb. Examples: "net: add localAddress and localPort
108+
to Socket", "src: fix typos in node_lttng_provider.h"
109+
- be meaningful; it is what other people see when they
110+
run `git shortlog` or `git log --oneline`.<br>
111+
Check the output of `git log --oneline files/you/changed` to find out
112+
what subsystem (or subsystems) your changes touch
108113
2. Keep the second line blank.
109114
3. Wrap all other lines at 72 columns.
115+
- If your patch fixes an open issue, you can add a reference to it at the end
116+
of the log. Use the `Fixes:` prefix and the full issue URL. For other references
117+
use `Refs:`. For example:
118+
```txt
119+
Fixes: https://github.com/nodejs/node/issues/1337
120+
Refs: http://eslint.org/docs/rules/space-in-parens.html
121+
Refs: https://github.com/nodejs/node/pull/3615
122+
```
110123
111124
A good commit log can look something like this:
112125
@@ -121,22 +134,9 @@ The body of the commit message can be several paragraphs, and
121134
please do proper word-wrap and keep columns shorter than about
122135
72 characters or so. That way, `git log` will show things
123136
nicely even when it is indented.
124-
```
125-
126-
The header line should be meaningful; it is what other people see when they
127-
run `git shortlog` or `git log --oneline`.
128-
129-
Check the output of `git log --oneline files_that_you_changed` to find out
130-
what subsystem (or subsystems) your changes touch.
131137
132-
If your patch fixes an open issue, you can add a reference to it at the end
133-
of the log. Use the `Fixes:` prefix and the full issue URL. For other references
134-
use `Refs:`. For example:
135-
136-
```txt
137138
Fixes: https://github.com/nodejs/node/issues/1337
138139
Refs: http://eslint.org/docs/rules/space-in-parens.html
139-
Refs: https://github.com/nodejs/node/pull/3615
140140
```
141141

142142
### Step 4: Rebase
@@ -200,9 +200,6 @@ core modules.
200200
$ git push origin my-branch
201201
```
202202

203-
Go to https://github.com/yourusername/node and select your branch.
204-
Click the 'Pull Request' button and fill out the form.
205-
206203
Pull requests are usually reviewed within a few days.
207204

208205
### Step 7: Discuss and update

0 commit comments

Comments
 (0)