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