diff options
author | Jonathan Corbet <corbet@lwn.net> | 2014-12-23 10:54:36 -0500 |
---|---|---|
committer | Jonathan Corbet <corbet@lwn.net> | 2014-12-23 10:54:36 -0500 |
commit | d00c455964002a8e7f126b16051e846a9f9877c6 (patch) | |
tree | fdca3d68eed6b5fde74ec348d7bb12a3f447e2c1 | |
parent | 0eea2314377146767273eadfc5b34b4f017777b2 (diff) |
Docs: SubmittingPatches: miscellaneous cleanups
Changes to make the formatting a bit more consistent and fix up wording in
various places.
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
-rw-r--r-- | Documentation/SubmittingPatches | 61 |
1 files changed, 38 insertions, 23 deletions
diff --git a/Documentation/SubmittingPatches b/Documentation/SubmittingPatches index a8308401a048..e6cbe59d890f 100644 --- a/Documentation/SubmittingPatches +++ b/Documentation/SubmittingPatches | |||
@@ -10,14 +10,18 @@ kernel, the process can sometimes be daunting if you're not familiar | |||
10 | with "the system." This text is a collection of suggestions which | 10 | with "the system." This text is a collection of suggestions which |
11 | can greatly increase the chances of your change being accepted. | 11 | can greatly increase the chances of your change being accepted. |
12 | 12 | ||
13 | Read Documentation/SubmitChecklist for a list of items to check | 13 | This document contains a large number of suggestions in a relatively terse |
14 | before submitting code. If you are submitting a driver, also read | 14 | format. For detailed information on how the kernel development process |
15 | works, see Documentation/development-process. Also, read | ||
16 | Documentation/SubmitChecklist for a list of items to check before | ||
17 | submitting code. If you are submitting a driver, also read | ||
15 | Documentation/SubmittingDrivers. | 18 | Documentation/SubmittingDrivers. |
16 | 19 | ||
17 | Many of these steps describe the default behavior of the git version | 20 | Many of these steps describe the default behavior of the git version |
18 | control system; if you use git to prepare your patches, you'll find much | 21 | control system; if you use git to prepare your patches, you'll find much |
19 | of the mechanical work done for you, though you'll still need to prepare | 22 | of the mechanical work done for you, though you'll still need to prepare |
20 | and document a sensible set of patches. | 23 | and document a sensible set of patches. In general, use of git will make |
24 | your life as a kernel developer easier. | ||
21 | 25 | ||
22 | -------------------------------------------- | 26 | -------------------------------------------- |
23 | SECTION 1 - CREATING AND SENDING YOUR CHANGE | 27 | SECTION 1 - CREATING AND SENDING YOUR CHANGE |
@@ -59,7 +63,7 @@ not in any lower subdirectory. | |||
59 | 63 | ||
60 | To create a patch for a single file, it is often sufficient to do: | 64 | To create a patch for a single file, it is often sufficient to do: |
61 | 65 | ||
62 | SRCTREE= linux-2.6 | 66 | SRCTREE= linux |
63 | MYFILE= drivers/net/mydriver.c | 67 | MYFILE= drivers/net/mydriver.c |
64 | 68 | ||
65 | cd $SRCTREE | 69 | cd $SRCTREE |
@@ -72,17 +76,16 @@ To create a patch for multiple files, you should unpack a "vanilla", | |||
72 | or unmodified kernel source tree, and generate a diff against your | 76 | or unmodified kernel source tree, and generate a diff against your |
73 | own source tree. For example: | 77 | own source tree. For example: |
74 | 78 | ||
75 | MYSRC= /devel/linux-2.6 | 79 | MYSRC= /devel/linux |
76 | 80 | ||
77 | tar xvfz linux-2.6.12.tar.gz | 81 | tar xvfz linux-3.19.tar.gz |
78 | mv linux-2.6.12 linux-2.6.12-vanilla | 82 | mv linux-3.19 linux-3.19-vanilla |
79 | diff -uprN -X linux-2.6.12-vanilla/Documentation/dontdiff \ | 83 | diff -uprN -X linux-3.19-vanilla/Documentation/dontdiff \ |
80 | linux-2.6.12-vanilla $MYSRC > /tmp/patch | 84 | linux-3.19-vanilla $MYSRC > /tmp/patch |
81 | 85 | ||
82 | "dontdiff" is a list of files which are generated by the kernel during | 86 | "dontdiff" is a list of files which are generated by the kernel during |
83 | the build process, and should be ignored in any diff(1)-generated | 87 | the build process, and should be ignored in any diff(1)-generated |
84 | patch. The "dontdiff" file is included in the kernel tree in | 88 | patch. |
85 | 2.6.12 and later. | ||
86 | 89 | ||
87 | Make sure your patch does not include any extra files which do not | 90 | Make sure your patch does not include any extra files which do not |
88 | belong in a patch submission. Make sure to review your patch -after- | 91 | belong in a patch submission. Make sure to review your patch -after- |
@@ -100,6 +103,7 @@ is another popular alternative. | |||
100 | 103 | ||
101 | 104 | ||
102 | 2) Describe your changes. | 105 | 2) Describe your changes. |
106 | ------------------------- | ||
103 | 107 | ||
104 | Describe your problem. Whether your patch is a one-line bug fix or | 108 | Describe your problem. Whether your patch is a one-line bug fix or |
105 | 5000 lines of a new feature, there must be an underlying problem that | 109 | 5000 lines of a new feature, there must be an underlying problem that |
@@ -141,10 +145,10 @@ See #3, next. | |||
141 | When you submit or resubmit a patch or patch series, include the | 145 | When you submit or resubmit a patch or patch series, include the |
142 | complete patch description and justification for it. Don't just | 146 | complete patch description and justification for it. Don't just |
143 | say that this is version N of the patch (series). Don't expect the | 147 | say that this is version N of the patch (series). Don't expect the |
144 | patch merger to refer back to earlier patch versions or referenced | 148 | subsystem maintainer to refer back to earlier patch versions or referenced |
145 | URLs to find the patch description and put that into the patch. | 149 | URLs to find the patch description and put that into the patch. |
146 | I.e., the patch (series) and its description should be self-contained. | 150 | I.e., the patch (series) and its description should be self-contained. |
147 | This benefits both the patch merger(s) and reviewers. Some reviewers | 151 | This benefits both the maintainers and reviewers. Some reviewers |
148 | probably didn't even receive earlier versions of the patch. | 152 | probably didn't even receive earlier versions of the patch. |
149 | 153 | ||
150 | Describe your changes in imperative mood, e.g. "make xyzzy do frotz" | 154 | Describe your changes in imperative mood, e.g. "make xyzzy do frotz" |
@@ -194,8 +198,9 @@ outputting the above style in the git log or git show commands | |||
194 | fixes = Fixes: %h (\"%s\") | 198 | fixes = Fixes: %h (\"%s\") |
195 | 199 | ||
196 | 3) Separate your changes. | 200 | 3) Separate your changes. |
201 | ------------------------- | ||
197 | 202 | ||
198 | Separate _logical changes_ into a single patch file. | 203 | Separate each _logical change_ into a separate patch. |
199 | 204 | ||
200 | For example, if your changes include both bug fixes and performance | 205 | For example, if your changes include both bug fixes and performance |
201 | enhancements for a single driver, separate those changes into two | 206 | enhancements for a single driver, separate those changes into two |
@@ -206,6 +211,10 @@ On the other hand, if you make a single change to numerous files, | |||
206 | group those changes into a single patch. Thus a single logical change | 211 | group those changes into a single patch. Thus a single logical change |
207 | is contained within a single patch. | 212 | is contained within a single patch. |
208 | 213 | ||
214 | The point to remember is that each patch should make an easily understood | ||
215 | change that can be verified by reviewers. Each patch should be justifiable | ||
216 | on its own merits. | ||
217 | |||
209 | If one patch depends on another patch in order for a change to be | 218 | If one patch depends on another patch in order for a change to be |
210 | complete, that is OK. Simply note "this patch depends on patch X" | 219 | complete, that is OK. Simply note "this patch depends on patch X" |
211 | in your patch description. | 220 | in your patch description. |
@@ -321,6 +330,7 @@ Trivial patches must qualify for one of the following rules: | |||
321 | 330 | ||
322 | 331 | ||
323 | 6) No MIME, no links, no compression, no attachments. Just plain text. | 332 | 6) No MIME, no links, no compression, no attachments. Just plain text. |
333 | ----------------------------------------------------------------------- | ||
324 | 334 | ||
325 | Linus and other kernel developers need to be able to read and comment | 335 | Linus and other kernel developers need to be able to read and comment |
326 | on the changes you are submitting. It is important for a kernel | 336 | on the changes you are submitting. It is important for a kernel |
@@ -344,15 +354,14 @@ See Documentation/email-clients.txt for hints about configuring | |||
344 | your e-mail client so that it sends your patches untouched. | 354 | your e-mail client so that it sends your patches untouched. |
345 | 355 | ||
346 | 7) E-mail size. | 356 | 7) E-mail size. |
347 | 357 | --------------- | |
348 | When sending patches to Linus, always follow step #7. | ||
349 | 358 | ||
350 | Large changes are not appropriate for mailing lists, and some | 359 | Large changes are not appropriate for mailing lists, and some |
351 | maintainers. If your patch, uncompressed, exceeds 300 kB in size, | 360 | maintainers. If your patch, uncompressed, exceeds 300 kB in size, |
352 | it is preferred that you store your patch on an Internet-accessible | 361 | it is preferred that you store your patch on an Internet-accessible |
353 | server, and provide instead a URL (link) pointing to your patch. | 362 | server, and provide instead a URL (link) pointing to your patch. But note |
354 | 363 | that if your patch exceeds 300 kB, it almost certainly needs to be broken up | |
355 | 364 | anyway. | |
356 | 365 | ||
357 | 8) Respond to review comments. | 366 | 8) Respond to review comments. |
358 | ------------------------------ | 367 | ------------------------------ |
@@ -385,6 +394,7 @@ busy times like merge windows. | |||
385 | 394 | ||
386 | 395 | ||
387 | 10) Include PATCH in the subject | 396 | 10) Include PATCH in the subject |
397 | -------------------------------- | ||
388 | 398 | ||
389 | Due to high e-mail traffic to Linus, and to linux-kernel, it is common | 399 | Due to high e-mail traffic to Linus, and to linux-kernel, it is common |
390 | convention to prefix your subject line with [PATCH]. This lets Linus | 400 | convention to prefix your subject line with [PATCH]. This lets Linus |
@@ -394,6 +404,7 @@ e-mail discussions. | |||
394 | 404 | ||
395 | 405 | ||
396 | 11) Sign your work | 406 | 11) Sign your work |
407 | ------------------ | ||
397 | 408 | ||
398 | To improve tracking of who did what, especially with patches that can | 409 | To improve tracking of who did what, especially with patches that can |
399 | percolate to their final resting place in the kernel through several | 410 | percolate to their final resting place in the kernel through several |
@@ -489,13 +500,14 @@ tree. | |||
489 | 500 | ||
490 | 501 | ||
491 | 12) When to use Acked-by: and Cc: | 502 | 12) When to use Acked-by: and Cc: |
503 | --------------------------------- | ||
492 | 504 | ||
493 | The Signed-off-by: tag indicates that the signer was involved in the | 505 | The Signed-off-by: tag indicates that the signer was involved in the |
494 | development of the patch, or that he/she was in the patch's delivery path. | 506 | development of the patch, or that he/she was in the patch's delivery path. |
495 | 507 | ||
496 | If a person was not directly involved in the preparation or handling of a | 508 | If a person was not directly involved in the preparation or handling of a |
497 | patch but wishes to signify and record their approval of it then they can | 509 | patch but wishes to signify and record their approval of it then they can |
498 | arrange to have an Acked-by: line added to the patch's changelog. | 510 | ask to have an Acked-by: line added to the patch's changelog. |
499 | 511 | ||
500 | Acked-by: is often used by the maintainer of the affected code when that | 512 | Acked-by: is often used by the maintainer of the affected code when that |
501 | maintainer neither contributed to nor forwarded the patch. | 513 | maintainer neither contributed to nor forwarded the patch. |
@@ -503,7 +515,8 @@ maintainer neither contributed to nor forwarded the patch. | |||
503 | Acked-by: is not as formal as Signed-off-by:. It is a record that the acker | 515 | Acked-by: is not as formal as Signed-off-by:. It is a record that the acker |
504 | has at least reviewed the patch and has indicated acceptance. Hence patch | 516 | has at least reviewed the patch and has indicated acceptance. Hence patch |
505 | mergers will sometimes manually convert an acker's "yep, looks good to me" | 517 | mergers will sometimes manually convert an acker's "yep, looks good to me" |
506 | into an Acked-by:. | 518 | into an Acked-by: (but note that it is usually better to ask for an |
519 | explicit ack). | ||
507 | 520 | ||
508 | Acked-by: does not necessarily indicate acknowledgement of the entire patch. | 521 | Acked-by: does not necessarily indicate acknowledgement of the entire patch. |
509 | For example, if a patch affects multiple subsystems and has an Acked-by: from | 522 | For example, if a patch affects multiple subsystems and has an Acked-by: from |
@@ -515,11 +528,13 @@ list archives. | |||
515 | If a person has had the opportunity to comment on a patch, but has not | 528 | If a person has had the opportunity to comment on a patch, but has not |
516 | provided such comments, you may optionally add a "Cc:" tag to the patch. | 529 | provided such comments, you may optionally add a "Cc:" tag to the patch. |
517 | This is the only tag which might be added without an explicit action by the | 530 | This is the only tag which might be added without an explicit action by the |
518 | person it names. This tag documents that potentially interested parties | 531 | person it names - but it should indicate that this person was copied on the |
519 | have been included in the discussion | 532 | patch. This tag documents that potentially interested parties |
533 | have been included in the discussion. | ||
520 | 534 | ||
521 | 535 | ||
522 | 13) Using Reported-by:, Tested-by:, Reviewed-by:, Suggested-by: and Fixes: | 536 | 13) Using Reported-by:, Tested-by:, Reviewed-by:, Suggested-by: and Fixes: |
537 | -------------------------------------------------------------------------- | ||
523 | 538 | ||
524 | The Reported-by tag gives credit to people who find bugs and report them and it | 539 | The Reported-by tag gives credit to people who find bugs and report them and it |
525 | hopefully inspires them to help us again in the future. Please note that if | 540 | hopefully inspires them to help us again in the future. Please note that if |