diff options
author | Mauro Carvalho Chehab <mchehab@s-opensource.com> | 2016-09-19 07:07:53 -0400 |
---|---|---|
committer | Jonathan Corbet <corbet@lwn.net> | 2016-09-20 20:39:17 -0400 |
commit | 5903019b2a5ef52ec70931dbf4109fe300479942 (patch) | |
tree | 284434cbbde38f51ff637cb6c41e049e6871f924 | |
parent | ceeb1a541556dc4aacd8f51d2000a55b079fa3da (diff) |
Documentation/SubmittingPatches: convert it to ReST markup
- Change the sections to use ReST markup;
- Add cross-references where needed;
- convert aspas to verbatim text;
- use code block tags;
- make Sphinx happy.
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
-rw-r--r-- | Documentation/SubmittingPatches | 207 |
1 files changed, 105 insertions, 102 deletions
diff --git a/Documentation/SubmittingPatches b/Documentation/SubmittingPatches index 8c79f1d53731..04a4284d8ee4 100644 --- a/Documentation/SubmittingPatches +++ b/Documentation/SubmittingPatches | |||
@@ -1,9 +1,6 @@ | |||
1 | 1 | ||
2 | How to Get Your Change Into the Linux Kernel | 2 | How to Get Your Change Into the Linux Kernel or Care And Operation Of Your Linus Torvalds |
3 | or | 3 | ========================================================================================= |
4 | Care And Operation Of Your Linus Torvalds | ||
5 | |||
6 | |||
7 | 4 | ||
8 | For a person or company who wishes to submit a change to the Linux | 5 | For a person or company who wishes to submit a change to the Linux |
9 | kernel, the process can sometimes be daunting if you're not familiar | 6 | kernel, the process can sometimes be daunting if you're not familiar |
@@ -24,9 +21,8 @@ of the mechanical work done for you, though you'll still need to prepare | |||
24 | and document a sensible set of patches. In general, use of git will make | 21 | and document a sensible set of patches. In general, use of git will make |
25 | your life as a kernel developer easier. | 22 | your life as a kernel developer easier. |
26 | 23 | ||
27 | -------------------------------------------- | 24 | Creating and Sending your Change |
28 | SECTION 1 - CREATING AND SENDING YOUR CHANGE | 25 | ******************************** |
29 | -------------------------------------------- | ||
30 | 26 | ||
31 | 27 | ||
32 | 0) Obtain a current source tree | 28 | 0) Obtain a current source tree |
@@ -34,35 +30,35 @@ SECTION 1 - CREATING AND SENDING YOUR CHANGE | |||
34 | 30 | ||
35 | If you do not have a repository with the current kernel source handy, use | 31 | If you do not have a repository with the current kernel source handy, use |
36 | git to obtain one. You'll want to start with the mainline repository, | 32 | git to obtain one. You'll want to start with the mainline repository, |
37 | which can be grabbed with: | 33 | which can be grabbed with:: |
38 | 34 | ||
39 | git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git | 35 | git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git |
40 | 36 | ||
41 | Note, however, that you may not want to develop against the mainline tree | 37 | Note, however, that you may not want to develop against the mainline tree |
42 | directly. Most subsystem maintainers run their own trees and want to see | 38 | directly. Most subsystem maintainers run their own trees and want to see |
43 | patches prepared against those trees. See the "T:" entry for the subsystem | 39 | patches prepared against those trees. See the **T:** entry for the subsystem |
44 | in the MAINTAINERS file to find that tree, or simply ask the maintainer if | 40 | in the MAINTAINERS file to find that tree, or simply ask the maintainer if |
45 | the tree is not listed there. | 41 | the tree is not listed there. |
46 | 42 | ||
47 | It is still possible to download kernel releases via tarballs (as described | 43 | It is still possible to download kernel releases via tarballs (as described |
48 | in the next section), but that is the hard way to do kernel development. | 44 | in the next section), but that is the hard way to do kernel development. |
49 | 45 | ||
50 | 1) "diff -up" | 46 | 1) ``diff -up`` |
51 | ------------ | 47 | --------------- |
52 | 48 | ||
53 | If you must generate your patches by hand, use "diff -up" or "diff -uprN" | 49 | If you must generate your patches by hand, use ``diff -up`` or ``diff -uprN`` |
54 | to create patches. Git generates patches in this form by default; if | 50 | to create patches. Git generates patches in this form by default; if |
55 | you're using git, you can skip this section entirely. | 51 | you're using git, you can skip this section entirely. |
56 | 52 | ||
57 | All changes to the Linux kernel occur in the form of patches, as | 53 | All changes to the Linux kernel occur in the form of patches, as |
58 | generated by diff(1). When creating your patch, make sure to create it | 54 | generated by diff(1). When creating your patch, make sure to create it |
59 | in "unified diff" format, as supplied by the '-u' argument to diff(1). | 55 | in "unified diff" format, as supplied by the ``-u`` argument to diff(1). |
60 | Also, please use the '-p' argument which shows which C function each | 56 | Also, please use the ``-p`` argument which shows which C function each |
61 | change is in - that makes the resultant diff a lot easier to read. | 57 | change is in - that makes the resultant diff a lot easier to read. |
62 | Patches should be based in the root kernel source directory, | 58 | Patches should be based in the root kernel source directory, |
63 | not in any lower subdirectory. | 59 | not in any lower subdirectory. |
64 | 60 | ||
65 | To create a patch for a single file, it is often sufficient to do: | 61 | To create a patch for a single file, it is often sufficient to do:: |
66 | 62 | ||
67 | SRCTREE= linux | 63 | SRCTREE= linux |
68 | MYFILE= drivers/net/mydriver.c | 64 | MYFILE= drivers/net/mydriver.c |
@@ -75,7 +71,7 @@ To create a patch for a single file, it is often sufficient to do: | |||
75 | 71 | ||
76 | To create a patch for multiple files, you should unpack a "vanilla", | 72 | To create a patch for multiple files, you should unpack a "vanilla", |
77 | or unmodified kernel source tree, and generate a diff against your | 73 | or unmodified kernel source tree, and generate a diff against your |
78 | own source tree. For example: | 74 | own source tree. For example:: |
79 | 75 | ||
80 | MYSRC= /devel/linux | 76 | MYSRC= /devel/linux |
81 | 77 | ||
@@ -84,7 +80,7 @@ own source tree. For example: | |||
84 | diff -uprN -X linux-3.19-vanilla/Documentation/dontdiff \ | 80 | diff -uprN -X linux-3.19-vanilla/Documentation/dontdiff \ |
85 | linux-3.19-vanilla $MYSRC > /tmp/patch | 81 | linux-3.19-vanilla $MYSRC > /tmp/patch |
86 | 82 | ||
87 | "dontdiff" is a list of files which are generated by the kernel during | 83 | ``dontdiff`` is a list of files which are generated by the kernel during |
88 | the build process, and should be ignored in any diff(1)-generated | 84 | the build process, and should be ignored in any diff(1)-generated |
89 | patch. | 85 | patch. |
90 | 86 | ||
@@ -93,18 +89,18 @@ belong in a patch submission. Make sure to review your patch -after- | |||
93 | generating it with diff(1), to ensure accuracy. | 89 | generating it with diff(1), to ensure accuracy. |
94 | 90 | ||
95 | If your changes produce a lot of deltas, you need to split them into | 91 | If your changes produce a lot of deltas, you need to split them into |
96 | individual patches which modify things in logical stages; see section | 92 | individual patches which modify things in logical stages; see |
97 | #3. This will facilitate review by other kernel developers, | 93 | :ref:`split_changes`. This will facilitate review by other kernel developers, |
98 | very important if you want your patch accepted. | 94 | very important if you want your patch accepted. |
99 | 95 | ||
100 | If you're using git, "git rebase -i" can help you with this process. If | 96 | If you're using git, ``git rebase -i`` can help you with this process. If |
101 | you're not using git, quilt <http://savannah.nongnu.org/projects/quilt> | 97 | you're not using git, quilt <http://savannah.nongnu.org/projects/quilt> |
102 | is another popular alternative. | 98 | is another popular alternative. |
103 | 99 | ||
100 | .. _describe_changes: | ||
104 | 101 | ||
105 | 102 | 2) Describe your changes | |
106 | 2) Describe your changes. | 103 | ------------------------ |
107 | ------------------------- | ||
108 | 104 | ||
109 | Describe your problem. Whether your patch is a one-line bug fix or | 105 | Describe your problem. Whether your patch is a one-line bug fix or |
110 | 5000 lines of a new feature, there must be an underlying problem that | 106 | 5000 lines of a new feature, there must be an underlying problem that |
@@ -137,11 +133,11 @@ as you intend it to. | |||
137 | 133 | ||
138 | The maintainer will thank you if you write your patch description in a | 134 | The maintainer will thank you if you write your patch description in a |
139 | form which can be easily pulled into Linux's source code management | 135 | form which can be easily pulled into Linux's source code management |
140 | system, git, as a "commit log". See #15, below. | 136 | system, git, as a "commit log". See :ref:`explicit_in_reply_to`. |
141 | 137 | ||
142 | Solve only one problem per patch. If your description starts to get | 138 | Solve only one problem per patch. If your description starts to get |
143 | long, that's a sign that you probably need to split up your patch. | 139 | long, that's a sign that you probably need to split up your patch. |
144 | See #3, next. | 140 | See :ref:`split_changes`. |
145 | 141 | ||
146 | When you submit or resubmit a patch or patch series, include the | 142 | When you submit or resubmit a patch or patch series, include the |
147 | complete patch description and justification for it. Don't just | 143 | complete patch description and justification for it. Don't just |
@@ -171,7 +167,7 @@ patch as submitted. | |||
171 | If you want to refer to a specific commit, don't just refer to the | 167 | If you want to refer to a specific commit, don't just refer to the |
172 | SHA-1 ID of the commit. Please also include the oneline summary of | 168 | SHA-1 ID of the commit. Please also include the oneline summary of |
173 | the commit, to make it easier for reviewers to know what it is about. | 169 | the commit, to make it easier for reviewers to know what it is about. |
174 | Example: | 170 | Example:: |
175 | 171 | ||
176 | Commit e21d2170f36602ae2708 ("video: remove unnecessary | 172 | Commit e21d2170f36602ae2708 ("video: remove unnecessary |
177 | platform_set_drvdata()") removed the unnecessary | 173 | platform_set_drvdata()") removed the unnecessary |
@@ -186,22 +182,24 @@ change five years from now. | |||
186 | 182 | ||
187 | If your patch fixes a bug in a specific commit, e.g. you found an issue using | 183 | If your patch fixes a bug in a specific commit, e.g. you found an issue using |
188 | git-bisect, please use the 'Fixes:' tag with the first 12 characters of the | 184 | git-bisect, please use the 'Fixes:' tag with the first 12 characters of the |
189 | SHA-1 ID, and the one line summary. For example: | 185 | SHA-1 ID, and the one line summary. For example:: |
190 | 186 | ||
191 | Fixes: e21d2170f366 ("video: remove unnecessary platform_set_drvdata()") | 187 | Fixes: e21d2170f366 ("video: remove unnecessary platform_set_drvdata()") |
192 | 188 | ||
193 | The following git-config settings can be used to add a pretty format for | 189 | The following git-config settings can be used to add a pretty format for |
194 | outputting the above style in the git log or git show commands | 190 | outputting the above style in the git log or git show commands:: |
195 | 191 | ||
196 | [core] | 192 | [core] |
197 | abbrev = 12 | 193 | abbrev = 12 |
198 | [pretty] | 194 | [pretty] |
199 | fixes = Fixes: %h (\"%s\") | 195 | fixes = Fixes: %h (\"%s\") |
200 | 196 | ||
201 | 3) Separate your changes. | 197 | .. _split_changes: |
202 | ------------------------- | 198 | |
199 | 3) Separate your changes | ||
200 | ------------------------ | ||
203 | 201 | ||
204 | Separate each _logical change_ into a separate patch. | 202 | Separate each **logical change** into a separate patch. |
205 | 203 | ||
206 | For example, if your changes include both bug fixes and performance | 204 | For example, if your changes include both bug fixes and performance |
207 | enhancements for a single driver, separate those changes into two | 205 | enhancements for a single driver, separate those changes into two |
@@ -217,12 +215,12 @@ change that can be verified by reviewers. Each patch should be justifiable | |||
217 | on its own merits. | 215 | on its own merits. |
218 | 216 | ||
219 | If one patch depends on another patch in order for a change to be | 217 | If one patch depends on another patch in order for a change to be |
220 | complete, that is OK. Simply note "this patch depends on patch X" | 218 | complete, that is OK. Simply note **"this patch depends on patch X"** |
221 | in your patch description. | 219 | in your patch description. |
222 | 220 | ||
223 | When dividing your change into a series of patches, take special care to | 221 | When dividing your change into a series of patches, take special care to |
224 | ensure that the kernel builds and runs properly after each patch in the | 222 | ensure that the kernel builds and runs properly after each patch in the |
225 | series. Developers using "git bisect" to track down a problem can end up | 223 | series. Developers using ``git bisect`` to track down a problem can end up |
226 | splitting your patch series at any point; they will not thank you if you | 224 | splitting your patch series at any point; they will not thank you if you |
227 | introduce bugs in the middle. | 225 | introduce bugs in the middle. |
228 | 226 | ||
@@ -231,8 +229,8 @@ then only post say 15 or so at a time and wait for review and integration. | |||
231 | 229 | ||
232 | 230 | ||
233 | 231 | ||
234 | 4) Style-check your changes. | 232 | 4) Style-check your changes |
235 | ---------------------------- | 233 | --------------------------- |
236 | 234 | ||
237 | Check your patch for basic style violations, details of which can be | 235 | Check your patch for basic style violations, details of which can be |
238 | found in Documentation/CodingStyle. Failure to do so simply wastes | 236 | found in Documentation/CodingStyle. Failure to do so simply wastes |
@@ -260,8 +258,8 @@ You should be able to justify all violations that remain in your | |||
260 | patch. | 258 | patch. |
261 | 259 | ||
262 | 260 | ||
263 | 5) Select the recipients for your patch. | 261 | 5) Select the recipients for your patch |
264 | ---------------------------------------- | 262 | --------------------------------------- |
265 | 263 | ||
266 | You should always copy the appropriate subsystem maintainer(s) on any patch | 264 | You should always copy the appropriate subsystem maintainer(s) on any patch |
267 | to code that they maintain; look through the MAINTAINERS file and the | 265 | to code that they maintain; look through the MAINTAINERS file and the |
@@ -295,7 +293,7 @@ to allow distributors to get the patch out to users; in such cases, | |||
295 | obviously, the patch should not be sent to any public lists. | 293 | obviously, the patch should not be sent to any public lists. |
296 | 294 | ||
297 | Patches that fix a severe bug in a released kernel should be directed | 295 | Patches that fix a severe bug in a released kernel should be directed |
298 | toward the stable maintainers by putting a line like this: | 296 | toward the stable maintainers by putting a line like this:: |
299 | 297 | ||
300 | Cc: stable@vger.kernel.org | 298 | Cc: stable@vger.kernel.org |
301 | 299 | ||
@@ -312,12 +310,14 @@ If changes affect userland-kernel interfaces, please send the MAN-PAGES | |||
312 | maintainer (as listed in the MAINTAINERS file) a man-pages patch, or at | 310 | maintainer (as listed in the MAINTAINERS file) a man-pages patch, or at |
313 | least a notification of the change, so that some information makes its way | 311 | least a notification of the change, so that some information makes its way |
314 | into the manual pages. User-space API changes should also be copied to | 312 | into the manual pages. User-space API changes should also be copied to |
315 | linux-api@vger.kernel.org. | 313 | linux-api@vger.kernel.org. |
316 | 314 | ||
317 | For small patches you may want to CC the Trivial Patch Monkey | 315 | For small patches you may want to CC the Trivial Patch Monkey |
318 | trivial@kernel.org which collects "trivial" patches. Have a look | 316 | trivial@kernel.org which collects "trivial" patches. Have a look |
319 | into the MAINTAINERS file for its current manager. | 317 | into the MAINTAINERS file for its current manager. |
318 | |||
320 | Trivial patches must qualify for one of the following rules: | 319 | Trivial patches must qualify for one of the following rules: |
320 | |||
321 | Spelling fixes in documentation | 321 | Spelling fixes in documentation |
322 | Spelling fixes for errors which could break grep(1) | 322 | Spelling fixes for errors which could break grep(1) |
323 | Warning fixes (cluttering with useless warnings is bad) | 323 | Warning fixes (cluttering with useless warnings is bad) |
@@ -332,8 +332,8 @@ Trivial patches must qualify for one of the following rules: | |||
332 | 332 | ||
333 | 333 | ||
334 | 334 | ||
335 | 6) No MIME, no links, no compression, no attachments. Just plain text. | 335 | 6) No MIME, no links, no compression, no attachments. Just plain text |
336 | ----------------------------------------------------------------------- | 336 | ---------------------------------------------------------------------- |
337 | 337 | ||
338 | Linus and other kernel developers need to be able to read and comment | 338 | Linus and other kernel developers need to be able to read and comment |
339 | on the changes you are submitting. It is important for a kernel | 339 | on the changes you are submitting. It is important for a kernel |
@@ -356,8 +356,8 @@ you to re-send them using MIME. | |||
356 | See Documentation/email-clients.txt for hints about configuring | 356 | See Documentation/email-clients.txt for hints about configuring |
357 | your e-mail client so that it sends your patches untouched. | 357 | your e-mail client so that it sends your patches untouched. |
358 | 358 | ||
359 | 7) E-mail size. | 359 | 7) E-mail size |
360 | --------------- | 360 | -------------- |
361 | 361 | ||
362 | Large changes are not appropriate for mailing lists, and some | 362 | Large changes are not appropriate for mailing lists, and some |
363 | maintainers. If your patch, uncompressed, exceeds 300 kB in size, | 363 | maintainers. If your patch, uncompressed, exceeds 300 kB in size, |
@@ -366,8 +366,8 @@ server, and provide instead a URL (link) pointing to your patch. But note | |||
366 | that if your patch exceeds 300 kB, it almost certainly needs to be broken up | 366 | that if your patch exceeds 300 kB, it almost certainly needs to be broken up |
367 | anyway. | 367 | anyway. |
368 | 368 | ||
369 | 8) Respond to review comments. | 369 | 8) Respond to review comments |
370 | ------------------------------ | 370 | ----------------------------- |
371 | 371 | ||
372 | Your patch will almost certainly get comments from reviewers on ways in | 372 | Your patch will almost certainly get comments from reviewers on ways in |
373 | which the patch can be improved. You must respond to those comments; | 373 | which the patch can be improved. You must respond to those comments; |
@@ -382,8 +382,8 @@ reviewers sometimes get grumpy. Even in that case, though, respond | |||
382 | politely and address the problems they have pointed out. | 382 | politely and address the problems they have pointed out. |
383 | 383 | ||
384 | 384 | ||
385 | 9) Don't get discouraged - or impatient. | 385 | 9) Don't get discouraged - or impatient |
386 | ---------------------------------------- | 386 | --------------------------------------- |
387 | 387 | ||
388 | After you have submitted your change, be patient and wait. Reviewers are | 388 | After you have submitted your change, be patient and wait. Reviewers are |
389 | busy people and may not get to your patch right away. | 389 | busy people and may not get to your patch right away. |
@@ -419,9 +419,10 @@ patch, which certifies that you wrote it or otherwise have the right to | |||
419 | pass it on as an open-source patch. The rules are pretty simple: if you | 419 | pass it on as an open-source patch. The rules are pretty simple: if you |
420 | can certify the below: | 420 | can certify the below: |
421 | 421 | ||
422 | Developer's Certificate of Origin 1.1 | 422 | Developer's Certificate of Origin 1.1 |
423 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
423 | 424 | ||
424 | By making a contribution to this project, I certify that: | 425 | By making a contribution to this project, I certify that: |
425 | 426 | ||
426 | (a) The contribution was created in whole or in part by me and I | 427 | (a) The contribution was created in whole or in part by me and I |
427 | have the right to submit it under the open source license | 428 | have the right to submit it under the open source license |
@@ -445,7 +446,7 @@ can certify the below: | |||
445 | maintained indefinitely and may be redistributed consistent with | 446 | maintained indefinitely and may be redistributed consistent with |
446 | this project or the open source license(s) involved. | 447 | this project or the open source license(s) involved. |
447 | 448 | ||
448 | then you just add a line saying | 449 | then you just add a line saying:: |
449 | 450 | ||
450 | Signed-off-by: Random J Developer <random@developer.example.org> | 451 | Signed-off-by: Random J Developer <random@developer.example.org> |
451 | 452 | ||
@@ -466,7 +467,7 @@ you add a line between the last Signed-off-by header and yours, indicating | |||
466 | the nature of your changes. While there is nothing mandatory about this, it | 467 | the nature of your changes. While there is nothing mandatory about this, it |
467 | seems like prepending the description with your mail and/or name, all | 468 | seems like prepending the description with your mail and/or name, all |
468 | enclosed in square brackets, is noticeable enough to make it obvious that | 469 | enclosed in square brackets, is noticeable enough to make it obvious that |
469 | you are responsible for last-minute changes. Example : | 470 | you are responsible for last-minute changes. Example:: |
470 | 471 | ||
471 | Signed-off-by: Random J Developer <random@developer.example.org> | 472 | Signed-off-by: Random J Developer <random@developer.example.org> |
472 | [lucky@maintainer.example.org: struct foo moved from foo.c to foo.h] | 473 | [lucky@maintainer.example.org: struct foo moved from foo.c to foo.h] |
@@ -481,15 +482,15 @@ which appears in the changelog. | |||
481 | Special note to back-porters: It seems to be a common and useful practice | 482 | Special note to back-porters: It seems to be a common and useful practice |
482 | to insert an indication of the origin of a patch at the top of the commit | 483 | to insert an indication of the origin of a patch at the top of the commit |
483 | message (just after the subject line) to facilitate tracking. For instance, | 484 | message (just after the subject line) to facilitate tracking. For instance, |
484 | here's what we see in a 3.x-stable release: | 485 | here's what we see in a 3.x-stable release:: |
485 | 486 | ||
486 | Date: Tue Oct 7 07:26:38 2014 -0400 | 487 | Date: Tue Oct 7 07:26:38 2014 -0400 |
487 | 488 | ||
488 | libata: Un-break ATA blacklist | 489 | libata: Un-break ATA blacklist |
489 | 490 | ||
490 | commit 1c40279960bcd7d52dbdf1d466b20d24b99176c8 upstream. | 491 | commit 1c40279960bcd7d52dbdf1d466b20d24b99176c8 upstream. |
491 | 492 | ||
492 | And here's what might appear in an older kernel once a patch is backported: | 493 | And here's what might appear in an older kernel once a patch is backported:: |
493 | 494 | ||
494 | Date: Tue May 13 22:12:27 2008 +0200 | 495 | Date: Tue May 13 22:12:27 2008 +0200 |
495 | 496 | ||
@@ -529,7 +530,7 @@ When in doubt people should refer to the original discussion in the mailing | |||
529 | list archives. | 530 | list archives. |
530 | 531 | ||
531 | If a person has had the opportunity to comment on a patch, but has not | 532 | If a person has had the opportunity to comment on a patch, but has not |
532 | provided such comments, you may optionally add a "Cc:" tag to the patch. | 533 | provided such comments, you may optionally add a ``Cc:`` tag to the patch. |
533 | This is the only tag which might be added without an explicit action by the | 534 | This is the only tag which might be added without an explicit action by the |
534 | person it names - but it should indicate that this person was copied on the | 535 | person it names - but it should indicate that this person was copied on the |
535 | patch. This tag documents that potentially interested parties | 536 | patch. This tag documents that potentially interested parties |
@@ -552,11 +553,12 @@ future patches, and ensures credit for the testers. | |||
552 | Reviewed-by:, instead, indicates that the patch has been reviewed and found | 553 | Reviewed-by:, instead, indicates that the patch has been reviewed and found |
553 | acceptable according to the Reviewer's Statement: | 554 | acceptable according to the Reviewer's Statement: |
554 | 555 | ||
555 | Reviewer's statement of oversight | 556 | Reviewer's statement of oversight |
557 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
556 | 558 | ||
557 | By offering my Reviewed-by: tag, I state that: | 559 | By offering my Reviewed-by: tag, I state that: |
558 | 560 | ||
559 | (a) I have carried out a technical review of this patch to | 561 | (a) I have carried out a technical review of this patch to |
560 | evaluate its appropriateness and readiness for inclusion into | 562 | evaluate its appropriateness and readiness for inclusion into |
561 | the mainline kernel. | 563 | the mainline kernel. |
562 | 564 | ||
@@ -594,7 +596,8 @@ A Fixes: tag indicates that the patch fixes an issue in a previous commit. It | |||
594 | is used to make it easy to determine where a bug originated, which can help | 596 | is used to make it easy to determine where a bug originated, which can help |
595 | review a bug fix. This tag also assists the stable kernel team in determining | 597 | review a bug fix. This tag also assists the stable kernel team in determining |
596 | which stable kernel versions should receive your fix. This is the preferred | 598 | which stable kernel versions should receive your fix. This is the preferred |
597 | method for indicating a bug fixed by the patch. See #2 above for more details. | 599 | method for indicating a bug fixed by the patch. See :ref:`describe_changes` |
600 | for more details. | ||
598 | 601 | ||
599 | 602 | ||
600 | 14) The canonical patch format | 603 | 14) The canonical patch format |
@@ -602,16 +605,16 @@ method for indicating a bug fixed by the patch. See #2 above for more details. | |||
602 | 605 | ||
603 | This section describes how the patch itself should be formatted. Note | 606 | This section describes how the patch itself should be formatted. Note |
604 | that, if you have your patches stored in a git repository, proper patch | 607 | that, if you have your patches stored in a git repository, proper patch |
605 | formatting can be had with "git format-patch". The tools cannot create | 608 | formatting can be had with ``git format-patch``. The tools cannot create |
606 | the necessary text, though, so read the instructions below anyway. | 609 | the necessary text, though, so read the instructions below anyway. |
607 | 610 | ||
608 | The canonical patch subject line is: | 611 | The canonical patch subject line is:: |
609 | 612 | ||
610 | Subject: [PATCH 001/123] subsystem: summary phrase | 613 | Subject: [PATCH 001/123] subsystem: summary phrase |
611 | 614 | ||
612 | The canonical patch message body contains the following: | 615 | The canonical patch message body contains the following: |
613 | 616 | ||
614 | - A "from" line specifying the patch author (only needed if the person | 617 | - A ``from`` line specifying the patch author (only needed if the person |
615 | sending the patch is not the author). | 618 | sending the patch is not the author). |
616 | 619 | ||
617 | - An empty line. | 620 | - An empty line. |
@@ -619,10 +622,10 @@ The canonical patch message body contains the following: | |||
619 | - The body of the explanation, line wrapped at 75 columns, which will | 622 | - The body of the explanation, line wrapped at 75 columns, which will |
620 | be copied to the permanent changelog to describe this patch. | 623 | be copied to the permanent changelog to describe this patch. |
621 | 624 | ||
622 | - The "Signed-off-by:" lines, described above, which will | 625 | - The ``Signed-off-by:`` lines, described above, which will |
623 | also go in the changelog. | 626 | also go in the changelog. |
624 | 627 | ||
625 | - A marker line containing simply "---". | 628 | - A marker line containing simply ``---``. |
626 | 629 | ||
627 | - Any additional comments not suitable for the changelog. | 630 | - Any additional comments not suitable for the changelog. |
628 | 631 | ||
@@ -633,32 +636,32 @@ alphabetically by subject line - pretty much any email reader will | |||
633 | support that - since because the sequence number is zero-padded, | 636 | support that - since because the sequence number is zero-padded, |
634 | the numerical and alphabetic sort is the same. | 637 | the numerical and alphabetic sort is the same. |
635 | 638 | ||
636 | The "subsystem" in the email's Subject should identify which | 639 | The ``subsystem`` in the email's Subject should identify which |
637 | area or subsystem of the kernel is being patched. | 640 | area or subsystem of the kernel is being patched. |
638 | 641 | ||
639 | The "summary phrase" in the email's Subject should concisely | 642 | The ``summary phrase`` in the email's Subject should concisely |
640 | describe the patch which that email contains. The "summary | 643 | describe the patch which that email contains. The ``summary |
641 | phrase" should not be a filename. Do not use the same "summary | 644 | phrase`` should not be a filename. Do not use the same ``summary |
642 | phrase" for every patch in a whole patch series (where a "patch | 645 | phrase`` for every patch in a whole patch series (where a ``patch |
643 | series" is an ordered sequence of multiple, related patches). | 646 | series`` is an ordered sequence of multiple, related patches). |
644 | 647 | ||
645 | Bear in mind that the "summary phrase" of your email becomes a | 648 | Bear in mind that the ``summary phrase`` of your email becomes a |
646 | globally-unique identifier for that patch. It propagates all the way | 649 | globally-unique identifier for that patch. It propagates all the way |
647 | into the git changelog. The "summary phrase" may later be used in | 650 | into the git changelog. The ``summary phrase`` may later be used in |
648 | developer discussions which refer to the patch. People will want to | 651 | developer discussions which refer to the patch. People will want to |
649 | google for the "summary phrase" to read discussion regarding that | 652 | google for the ``summary phrase`` to read discussion regarding that |
650 | patch. It will also be the only thing that people may quickly see | 653 | patch. It will also be the only thing that people may quickly see |
651 | when, two or three months later, they are going through perhaps | 654 | when, two or three months later, they are going through perhaps |
652 | thousands of patches using tools such as "gitk" or "git log | 655 | thousands of patches using tools such as ``gitk`` or "git log |
653 | --oneline". | 656 | --oneline". |
654 | 657 | ||
655 | For these reasons, the "summary" must be no more than 70-75 | 658 | For these reasons, the ``summary`` must be no more than 70-75 |
656 | characters, and it must describe both what the patch changes, as well | 659 | characters, and it must describe both what the patch changes, as well |
657 | as why the patch might be necessary. It is challenging to be both | 660 | as why the patch might be necessary. It is challenging to be both |
658 | succinct and descriptive, but that is what a well-written summary | 661 | succinct and descriptive, but that is what a well-written summary |
659 | should do. | 662 | should do. |
660 | 663 | ||
661 | The "summary phrase" may be prefixed by tags enclosed in square | 664 | The ``summary phrase`` may be prefixed by tags enclosed in square |
662 | brackets: "Subject: [PATCH <tag>...] <summary phrase>". The tags are | 665 | brackets: "Subject: [PATCH <tag>...] <summary phrase>". The tags are |
663 | not considered part of the summary phrase, but describe how the patch | 666 | not considered part of the summary phrase, but describe how the patch |
664 | should be treated. Common tags might include a version descriptor if | 667 | should be treated. Common tags might include a version descriptor if |
@@ -670,19 +673,19 @@ that developers understand the order in which the patches should be | |||
670 | applied and that they have reviewed or applied all of the patches in | 673 | applied and that they have reviewed or applied all of the patches in |
671 | the patch series. | 674 | the patch series. |
672 | 675 | ||
673 | A couple of example Subjects: | 676 | A couple of example Subjects:: |
674 | 677 | ||
675 | Subject: [PATCH 2/5] ext2: improve scalability of bitmap searching | 678 | Subject: [PATCH 2/5] ext2: improve scalability of bitmap searching |
676 | Subject: [PATCH v2 01/27] x86: fix eflags tracking | 679 | Subject: [PATCH v2 01/27] x86: fix eflags tracking |
677 | 680 | ||
678 | The "from" line must be the very first line in the message body, | 681 | The ``from`` line must be the very first line in the message body, |
679 | and has the form: | 682 | and has the form: |
680 | 683 | ||
681 | From: Original Author <author@example.com> | 684 | From: Original Author <author@example.com> |
682 | 685 | ||
683 | The "from" line specifies who will be credited as the author of the | 686 | The ``from`` line specifies who will be credited as the author of the |
684 | patch in the permanent changelog. If the "from" line is missing, | 687 | patch in the permanent changelog. If the ``from`` line is missing, |
685 | then the "From:" line from the email header will be used to determine | 688 | then the ``From:`` line from the email header will be used to determine |
686 | the patch author in the changelog. | 689 | the patch author in the changelog. |
687 | 690 | ||
688 | The explanation body will be committed to the permanent source | 691 | The explanation body will be committed to the permanent source |
@@ -694,23 +697,23 @@ especially useful for people who might be searching the commit logs | |||
694 | looking for the applicable patch. If a patch fixes a compile failure, | 697 | looking for the applicable patch. If a patch fixes a compile failure, |
695 | it may not be necessary to include _all_ of the compile failures; just | 698 | it may not be necessary to include _all_ of the compile failures; just |
696 | enough that it is likely that someone searching for the patch can find | 699 | enough that it is likely that someone searching for the patch can find |
697 | it. As in the "summary phrase", it is important to be both succinct as | 700 | it. As in the ``summary phrase``, it is important to be both succinct as |
698 | well as descriptive. | 701 | well as descriptive. |
699 | 702 | ||
700 | The "---" marker line serves the essential purpose of marking for patch | 703 | The ``---`` marker line serves the essential purpose of marking for patch |
701 | handling tools where the changelog message ends. | 704 | handling tools where the changelog message ends. |
702 | 705 | ||
703 | One good use for the additional comments after the "---" marker is for | 706 | One good use for the additional comments after the ``---`` marker is for |
704 | a diffstat, to show what files have changed, and the number of | 707 | a diffstat, to show what files have changed, and the number of |
705 | inserted and deleted lines per file. A diffstat is especially useful | 708 | inserted and deleted lines per file. A diffstat is especially useful |
706 | on bigger patches. Other comments relevant only to the moment or the | 709 | on bigger patches. Other comments relevant only to the moment or the |
707 | maintainer, not suitable for the permanent changelog, should also go | 710 | maintainer, not suitable for the permanent changelog, should also go |
708 | here. A good example of such comments might be "patch changelogs" | 711 | here. A good example of such comments might be ``patch changelogs`` |
709 | which describe what has changed between the v1 and v2 version of the | 712 | which describe what has changed between the v1 and v2 version of the |
710 | patch. | 713 | patch. |
711 | 714 | ||
712 | If you are going to include a diffstat after the "---" marker, please | 715 | If you are going to include a diffstat after the ``---`` marker, please |
713 | use diffstat options "-p 1 -w 70" so that filenames are listed from | 716 | use diffstat options ``-p 1 -w 70`` so that filenames are listed from |
714 | the top of the kernel source tree and don't use too much horizontal | 717 | the top of the kernel source tree and don't use too much horizontal |
715 | space (easily fit in 80 columns, maybe with some indentation). (git | 718 | space (easily fit in 80 columns, maybe with some indentation). (git |
716 | generates appropriate diffstats by default.) | 719 | generates appropriate diffstats by default.) |
@@ -718,11 +721,13 @@ generates appropriate diffstats by default.) | |||
718 | See more details on the proper patch format in the following | 721 | See more details on the proper patch format in the following |
719 | references. | 722 | references. |
720 | 723 | ||
724 | .. _explicit_in_reply_to: | ||
725 | |||
721 | 15) Explicit In-Reply-To headers | 726 | 15) Explicit In-Reply-To headers |
722 | -------------------------------- | 727 | -------------------------------- |
723 | 728 | ||
724 | It can be helpful to manually add In-Reply-To: headers to a patch | 729 | It can be helpful to manually add In-Reply-To: headers to a patch |
725 | (e.g., when using "git send-email") to associate the patch with | 730 | (e.g., when using ``git send-email``) to associate the patch with |
726 | previous relevant discussion, e.g. to link a bug fix to the email with | 731 | previous relevant discussion, e.g. to link a bug fix to the email with |
727 | the bug report. However, for a multi-patch series, it is generally | 732 | the bug report. However, for a multi-patch series, it is generally |
728 | best to avoid using In-Reply-To: to link to older versions of the | 733 | best to avoid using In-Reply-To: to link to older versions of the |
@@ -732,12 +737,12 @@ helpful, you can use the https://lkml.kernel.org/ redirector (e.g., in | |||
732 | the cover email text) to link to an earlier version of the patch series. | 737 | the cover email text) to link to an earlier version of the patch series. |
733 | 738 | ||
734 | 739 | ||
735 | 16) Sending "git pull" requests | 740 | 16) Sending ``git pull`` requests |
736 | ------------------------------- | 741 | --------------------------------- |
737 | 742 | ||
738 | If you have a series of patches, it may be most convenient to have the | 743 | If you have a series of patches, it may be most convenient to have the |
739 | maintainer pull them directly into the subsystem repository with a | 744 | maintainer pull them directly into the subsystem repository with a |
740 | "git pull" operation. Note, however, that pulling patches from a developer | 745 | ``git pull`` operation. Note, however, that pulling patches from a developer |
741 | requires a higher degree of trust than taking patches from a mailing list. | 746 | requires a higher degree of trust than taking patches from a mailing list. |
742 | As a result, many subsystem maintainers are reluctant to take pull | 747 | As a result, many subsystem maintainers are reluctant to take pull |
743 | requests, especially from new, unknown developers. If in doubt you can use | 748 | requests, especially from new, unknown developers. If in doubt you can use |
@@ -746,7 +751,7 @@ series, giving the maintainer the option of using either. | |||
746 | 751 | ||
747 | A pull request should have [GIT] or [PULL] in the subject line. The | 752 | A pull request should have [GIT] or [PULL] in the subject line. The |
748 | request itself should include the repository name and the branch of | 753 | request itself should include the repository name and the branch of |
749 | interest on a single line; it should look something like: | 754 | interest on a single line; it should look something like:: |
750 | 755 | ||
751 | Please pull from | 756 | Please pull from |
752 | 757 | ||
@@ -755,10 +760,10 @@ interest on a single line; it should look something like: | |||
755 | to get these changes: | 760 | to get these changes: |
756 | 761 | ||
757 | A pull request should also include an overall message saying what will be | 762 | A pull request should also include an overall message saying what will be |
758 | included in the request, a "git shortlog" listing of the patches | 763 | included in the request, a ``git shortlog`` listing of the patches |
759 | themselves, and a diffstat showing the overall effect of the patch series. | 764 | themselves, and a diffstat showing the overall effect of the patch series. |
760 | The easiest way to get all this information together is, of course, to let | 765 | The easiest way to get all this information together is, of course, to let |
761 | git do it for you with the "git request-pull" command. | 766 | git do it for you with the ``git request-pull`` command. |
762 | 767 | ||
763 | Some maintainers (including Linus) want to see pull requests from signed | 768 | Some maintainers (including Linus) want to see pull requests from signed |
764 | commits; that increases their confidence that the request actually came | 769 | commits; that increases their confidence that the request actually came |
@@ -771,7 +776,7 @@ new developers, but there is no way around it. Attending conferences can | |||
771 | be a good way to find developers who can sign your key. | 776 | be a good way to find developers who can sign your key. |
772 | 777 | ||
773 | Once you have prepared a patch series in git that you wish to have somebody | 778 | Once you have prepared a patch series in git that you wish to have somebody |
774 | pull, create a signed tag with "git tag -s". This will create a new tag | 779 | pull, create a signed tag with ``git tag -s``. This will create a new tag |
775 | identifying the last commit in the series and containing a signature | 780 | identifying the last commit in the series and containing a signature |
776 | created with your private key. You will also have the opportunity to add a | 781 | created with your private key. You will also have the opportunity to add a |
777 | changelog-style message to the tag; this is an ideal place to describe the | 782 | changelog-style message to the tag; this is an ideal place to describe the |
@@ -782,14 +787,13 @@ are working from, don't forget to push the signed tag explicitly to the | |||
782 | public tree. | 787 | public tree. |
783 | 788 | ||
784 | When generating your pull request, use the signed tag as the target. A | 789 | When generating your pull request, use the signed tag as the target. A |
785 | command like this will do the trick: | 790 | command like this will do the trick:: |
786 | 791 | ||
787 | git request-pull master git://my.public.tree/linux.git my-signed-tag | 792 | git request-pull master git://my.public.tree/linux.git my-signed-tag |
788 | 793 | ||
789 | 794 | ||
790 | ---------------------- | 795 | REFERENCES |
791 | SECTION 2 - REFERENCES | 796 | ********** |
792 | ---------------------- | ||
793 | 797 | ||
794 | Andrew Morton, "The perfect patch" (tpp). | 798 | Andrew Morton, "The perfect patch" (tpp). |
795 | <http://www.ozlabs.org/~akpm/stuff/tpp.txt> | 799 | <http://www.ozlabs.org/~akpm/stuff/tpp.txt> |
@@ -818,4 +822,3 @@ Andi Kleen, "On submitting kernel patches" | |||
818 | Some strategies to get difficult or controversial changes in. | 822 | Some strategies to get difficult or controversial changes in. |
819 | http://halobates.de/on-submitting-patches.pdf | 823 | http://halobates.de/on-submitting-patches.pdf |
820 | 824 | ||
821 | -- | ||