Skip to content

Commit 47b3992

Browse files
bf4evanlucas
authored andcommittedMay 2, 2017
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 <[email protected]> Reviewed-By: Sam Roberts <[email protected]>
1 parent 661ff6d commit 47b3992

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
@@ -100,15 +100,28 @@ $ git commit
100100
Writing good commit logs is important. A commit log should describe what
101101
changed and why. Follow these guidelines when writing one:
102102

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

144144
### Step 4: Rebase
@@ -203,9 +203,6 @@ core modules.
203203
$ git push origin my-branch
204204
```
205205

206-
Go to https://github.com/yourusername/node and select your branch.
207-
Click the 'Pull Request' button and fill out the form.
208-
209206
Pull requests are usually reviewed within a few days.
210207

211208
### Step 7: Discuss and update

0 commit comments

Comments
 (0)
Please sign in to comment.