|
1 | | -Checklist (and a short version for the impatient): |
2 | | - |
3 | | - Commits: |
4 | | - |
5 | | - - make commits of logical units |
6 | | - - check for unnecessary whitespace with "git diff --check" |
7 | | - before committing |
8 | | - - do not check in commented out code or unneeded files |
9 | | - - the first line of the commit message should be a short |
10 | | - description (50 characters is the soft limit, see DISCUSSION |
11 | | - in git-commit(1)), and should skip the full stop |
12 | | - - it is also conventional in most cases to prefix the |
13 | | - first line with "area: " where the area is a filename |
14 | | - or identifier for the general area of the code being |
15 | | - modified, e.g. |
16 | | - . archive: ustar header checksum is computed unsigned |
17 | | - . git-cherry-pick.txt: clarify the use of revision range notation |
18 | | - (if in doubt which identifier to use, run "git log --no-merges" |
19 | | - on the files you are modifying to see the current conventions) |
20 | | - - the body should provide a meaningful commit message, which: |
21 | | - . explains the problem the change tries to solve, iow, what |
22 | | - is wrong with the current code without the change. |
23 | | - . justifies the way the change solves the problem, iow, why |
24 | | - the result with the change is better. |
25 | | - . alternate solutions considered but discarded, if any. |
26 | | - - describe changes in imperative mood, e.g. "make xyzzy do frotz" |
27 | | - instead of "[This patch] makes xyzzy do frotz" or "[I] changed |
28 | | - xyzzy to do frotz", as if you are giving orders to the codebase |
29 | | - to change its behaviour. |
30 | | - - try to make sure your explanation can be understood without |
31 | | - external resources. Instead of giving a URL to a mailing list |
32 | | - archive, summarize the relevant points of the discussion. |
33 | | - - add a "Signed-off-by: Your Name < [email protected]>" line to the |
34 | | - commit message (or just use the option "-s" when committing) |
35 | | - to confirm that you agree to the Developer's Certificate of Origin |
36 | | - - make sure that you have tests for the bug you are fixing |
37 | | - - make sure that the test suite passes after your commit |
38 | | - |
39 | | - Patch: |
40 | | - |
41 | | - - use "git format-patch -M" to create the patch |
42 | | - - do not PGP sign your patch |
43 | | - - do not attach your patch, but read in the mail |
44 | | - body, unless you cannot teach your mailer to |
45 | | - leave the formatting of the patch alone. |
46 | | - - be careful doing cut & paste into your mailer, not to |
47 | | - corrupt whitespaces. |
48 | | - - provide additional information (which is unsuitable for |
49 | | - the commit message) between the "---" and the diffstat |
50 | | - - if you change, add, or remove a command line option or |
51 | | - make some other user interface change, the associated |
52 | | - documentation should be updated as well. |
53 | | - - if your name is not writable in ASCII, make sure that |
54 | | - you send off a message in the correct encoding. |
55 | | - - send the patch to the list ( [email protected]) and the |
56 | | - maintainer ( [email protected]) if (and only if) the patch |
57 | | - is ready for inclusion. If you use git-send-email(1), |
58 | | - please test it first by sending email to yourself. |
59 | | - - see below for instructions specific to your mailer |
60 | | - |
61 | | -Long version: |
62 | | - |
63 | 1 | Here are some guidelines for people who want to contribute their code |
64 | 2 | to this software. |
65 | 3 |
|
@@ -119,36 +57,81 @@ change, the approach taken by the change, and if relevant how this |
119 | 57 | differs substantially from the prior version, are all good things |
120 | 58 | to have. |
121 | 59 |
|
| 60 | +Make sure that you have tests for the bug you are fixing. |
| 61 | + |
| 62 | +When adding a new feature, make sure that you have new tests to show |
| 63 | +the feature triggers the new behaviour when it should, and to show the |
| 64 | +feature does not trigger when it shouldn't. Also make sure that the |
| 65 | +test suite passes after your commit. Do not forget to update the |
| 66 | +documentation to describe the updated behaviour. |
| 67 | + |
122 | 68 | Oh, another thing. I am picky about whitespaces. Make sure your |
123 | 69 | changes do not trigger errors with the sample pre-commit hook shipped |
124 | 70 | in templates/hooks--pre-commit. To help ensure this does not happen, |
125 | 71 | run git diff --check on your changes before you commit. |
126 | 72 |
|
127 | 73 |
|
128 | | -(2) Generate your patch using git tools out of your commits. |
| 74 | +(2) Describe your changes well. |
| 75 | + |
| 76 | +The first line of the commit message should be a short description (50 |
| 77 | +characters is the soft limit, see DISCUSSION in git-commit(1)), and |
| 78 | +should skip the full stop. It is also conventional in most cases to |
| 79 | +prefix the first line with "area: " where the area is a filename or |
| 80 | +identifier for the general area of the code being modified, e.g. |
| 81 | + |
| 82 | + . archive: ustar header checksum is computed unsigned |
| 83 | + . git-cherry-pick.txt: clarify the use of revision range notation |
| 84 | + |
| 85 | +If in doubt which identifier to use, run "git log --no-merges" on the |
| 86 | +files you are modifying to see the current conventions. |
| 87 | + |
| 88 | +The body should provide a meaningful commit message, which: |
| 89 | + |
| 90 | + . explains the problem the change tries to solve, iow, what is wrong |
| 91 | + with the current code without the change. |
| 92 | + |
| 93 | + . justifies the way the change solves the problem, iow, why the |
| 94 | + result with the change is better. |
| 95 | + |
| 96 | + . alternate solutions considered but discarded, if any. |
| 97 | + |
| 98 | +Describe your changes in imperative mood, e.g. "make xyzzy do frotz" |
| 99 | +instead of "[This patch] makes xyzzy do frotz" or "[I] changed xyzzy |
| 100 | +to do frotz", as if you are giving orders to the codebase to change |
| 101 | +its behaviour. Try to make sure your explanation can be understood |
| 102 | +without external resources. Instead of giving a URL to a mailing list |
| 103 | +archive, summarize the relevant points of the discussion. |
| 104 | + |
| 105 | + |
| 106 | +(3) Generate your patch using git tools out of your commits. |
129 | 107 |
|
130 | 108 | git based diff tools generate unidiff which is the preferred format. |
131 | 109 |
|
132 | 110 | You do not have to be afraid to use -M option to "git diff" or |
133 | 111 | "git format-patch", if your patch involves file renames. The |
134 | 112 | receiving end can handle them just fine. |
135 | 113 |
|
136 | | -Please make sure your patch does not include any extra files |
137 | | -which do not belong in a patch submission. Make sure to review |
| 114 | +Please make sure your patch does not add commented out debugging code, |
| 115 | +or include any extra files which do not relate to what your patch |
| 116 | +is trying to achieve. Make sure to review |
138 | 117 | your patch after generating it, to ensure accuracy. Before |
139 | 118 | sending out, please make sure it cleanly applies to the "master" |
140 | 119 | branch head. If you are preparing a work based on "next" branch, |
141 | 120 | that is fine, but please mark it as such. |
142 | 121 |
|
143 | 122 |
|
144 | | -(3) Sending your patches. |
| 123 | +(4) Sending your patches. |
145 | 124 |
|
146 | 125 | People on the git mailing list need to be able to read and |
147 | 126 | comment on the changes you are submitting. It is important for |
148 | 127 | a developer to be able to "quote" your changes, using standard |
149 | 128 | e-mail tools, so that they may comment on specific portions of |
150 | 129 | your code. For this reason, all patches should be submitted |
151 | | -"inline". WARNING: Be wary of your MUAs word-wrap |
| 130 | +"inline". If your log message (including your name on the |
| 131 | +Signed-off-by line) is not writable in ASCII, make sure that |
| 132 | +you send off a message in the correct encoding. |
| 133 | + |
| 134 | +WARNING: Be wary of your MUAs word-wrap |
152 | 135 | corrupting your patch. Do not cut-n-paste your patch; you can |
153 | 136 | lose tabs that way if you are not careful. |
154 | 137 |
|
@@ -200,19 +183,21 @@ patch, format it as "multipart/signed", not a text/plain message |
200 | 183 | that starts with '-----BEGIN PGP SIGNED MESSAGE-----'. That is |
201 | 184 | not a text/plain, it's something else. |
202 | 185 |
|
203 | | -Unless your patch is a very trivial and an obviously correct one, |
204 | | -first send it with "To:" set to the mailing list, with "cc:" listing |
| 186 | +Send your patch with "To:" set to the mailing list, with "cc:" listing |
205 | 187 | people who are involved in the area you are touching (the output from |
206 | 188 | "git blame $path" and "git shortlog --no-merges $path" would help to |
207 | | -identify them), to solicit comments and reviews. After the list |
208 | | -reached a consensus that it is a good idea to apply the patch, re-send |
209 | | -it with "To:" set to the maintainer and optionally "cc:" the list for |
210 | | -inclusion. Do not forget to add trailers such as "Acked-by:", |
211 | | -"Reviewed-by:" and "Tested-by:" after your "Signed-off-by:" line as |
212 | | -necessary. |
| 189 | +identify them), to solicit comments and reviews. |
| 190 | + |
| 191 | +After the list reached a consensus that it is a good idea to apply the |
| 192 | +patch, re-send it with "To:" set to the maintainer and "cc:" the |
| 193 | +list for inclusion. |
| 194 | + |
| 195 | +Do not forget to add trailers such as "Acked-by:", "Reviewed-by:" and |
| 196 | +"Tested-by:" lines as necessary to credit people who helped your |
| 197 | +patch. |
213 | 198 |
|
214 | 199 |
|
215 | | -(4) Sign your work |
| 200 | +(5) Sign your work |
216 | 201 |
|
217 | 202 | To improve tracking of who did what, we've borrowed the |
218 | 203 | "sign-off" procedure from the Linux kernel project on patches |
|
0 commit comments