aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@s-opensource.com>2016-09-19 07:07:53 -0400
committerJonathan Corbet <corbet@lwn.net>2016-09-20 20:39:17 -0400
commit5903019b2a5ef52ec70931dbf4109fe300479942 (patch)
tree284434cbbde38f51ff637cb6c41e049e6871f924
parentceeb1a541556dc4aacd8f51d2000a55b079fa3da (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/SubmittingPatches207
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 2How 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
8For a person or company who wishes to submit a change to the Linux 5For a person or company who wishes to submit a change to the Linux
9kernel, the process can sometimes be daunting if you're not familiar 6kernel, 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
24and document a sensible set of patches. In general, use of git will make 21and document a sensible set of patches. In general, use of git will make
25your life as a kernel developer easier. 22your life as a kernel developer easier.
26 23
27-------------------------------------------- 24Creating and Sending your Change
28SECTION 1 - CREATING AND SENDING YOUR CHANGE 25********************************
29--------------------------------------------
30 26
31 27
320) Obtain a current source tree 280) Obtain a current source tree
@@ -34,35 +30,35 @@ SECTION 1 - CREATING AND SENDING YOUR CHANGE
34 30
35If you do not have a repository with the current kernel source handy, use 31If you do not have a repository with the current kernel source handy, use
36git to obtain one. You'll want to start with the mainline repository, 32git to obtain one. You'll want to start with the mainline repository,
37which can be grabbed with: 33which 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
41Note, however, that you may not want to develop against the mainline tree 37Note, however, that you may not want to develop against the mainline tree
42directly. Most subsystem maintainers run their own trees and want to see 38directly. Most subsystem maintainers run their own trees and want to see
43patches prepared against those trees. See the "T:" entry for the subsystem 39patches prepared against those trees. See the **T:** entry for the subsystem
44in the MAINTAINERS file to find that tree, or simply ask the maintainer if 40in the MAINTAINERS file to find that tree, or simply ask the maintainer if
45the tree is not listed there. 41the tree is not listed there.
46 42
47It is still possible to download kernel releases via tarballs (as described 43It is still possible to download kernel releases via tarballs (as described
48in the next section), but that is the hard way to do kernel development. 44in the next section), but that is the hard way to do kernel development.
49 45
501) "diff -up" 461) ``diff -up``
51------------ 47---------------
52 48
53If you must generate your patches by hand, use "diff -up" or "diff -uprN" 49If you must generate your patches by hand, use ``diff -up`` or ``diff -uprN``
54to create patches. Git generates patches in this form by default; if 50to create patches. Git generates patches in this form by default; if
55you're using git, you can skip this section entirely. 51you're using git, you can skip this section entirely.
56 52
57All changes to the Linux kernel occur in the form of patches, as 53All changes to the Linux kernel occur in the form of patches, as
58generated by diff(1). When creating your patch, make sure to create it 54generated by diff(1). When creating your patch, make sure to create it
59in "unified diff" format, as supplied by the '-u' argument to diff(1). 55in "unified diff" format, as supplied by the ``-u`` argument to diff(1).
60Also, please use the '-p' argument which shows which C function each 56Also, please use the ``-p`` argument which shows which C function each
61change is in - that makes the resultant diff a lot easier to read. 57change is in - that makes the resultant diff a lot easier to read.
62Patches should be based in the root kernel source directory, 58Patches should be based in the root kernel source directory,
63not in any lower subdirectory. 59not in any lower subdirectory.
64 60
65To create a patch for a single file, it is often sufficient to do: 61To 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
76To create a patch for multiple files, you should unpack a "vanilla", 72To create a patch for multiple files, you should unpack a "vanilla",
77or unmodified kernel source tree, and generate a diff against your 73or unmodified kernel source tree, and generate a diff against your
78own source tree. For example: 74own 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
88the build process, and should be ignored in any diff(1)-generated 84the build process, and should be ignored in any diff(1)-generated
89patch. 85patch.
90 86
@@ -93,18 +89,18 @@ belong in a patch submission. Make sure to review your patch -after-
93generating it with diff(1), to ensure accuracy. 89generating it with diff(1), to ensure accuracy.
94 90
95If your changes produce a lot of deltas, you need to split them into 91If your changes produce a lot of deltas, you need to split them into
96individual patches which modify things in logical stages; see section 92individual 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,
98very important if you want your patch accepted. 94very important if you want your patch accepted.
99 95
100If you're using git, "git rebase -i" can help you with this process. If 96If you're using git, ``git rebase -i`` can help you with this process. If
101you're not using git, quilt <http://savannah.nongnu.org/projects/quilt> 97you're not using git, quilt <http://savannah.nongnu.org/projects/quilt>
102is another popular alternative. 98is another popular alternative.
103 99
100.. _describe_changes:
104 101
105 1022) Describe your changes
1062) Describe your changes. 103------------------------
107-------------------------
108 104
109Describe your problem. Whether your patch is a one-line bug fix or 105Describe your problem. Whether your patch is a one-line bug fix or
1105000 lines of a new feature, there must be an underlying problem that 1065000 lines of a new feature, there must be an underlying problem that
@@ -137,11 +133,11 @@ as you intend it to.
137 133
138The maintainer will thank you if you write your patch description in a 134The maintainer will thank you if you write your patch description in a
139form which can be easily pulled into Linux's source code management 135form which can be easily pulled into Linux's source code management
140system, git, as a "commit log". See #15, below. 136system, git, as a "commit log". See :ref:`explicit_in_reply_to`.
141 137
142Solve only one problem per patch. If your description starts to get 138Solve only one problem per patch. If your description starts to get
143long, that's a sign that you probably need to split up your patch. 139long, that's a sign that you probably need to split up your patch.
144See #3, next. 140See :ref:`split_changes`.
145 141
146When you submit or resubmit a patch or patch series, include the 142When you submit or resubmit a patch or patch series, include the
147complete patch description and justification for it. Don't just 143complete patch description and justification for it. Don't just
@@ -171,7 +167,7 @@ patch as submitted.
171If you want to refer to a specific commit, don't just refer to the 167If you want to refer to a specific commit, don't just refer to the
172SHA-1 ID of the commit. Please also include the oneline summary of 168SHA-1 ID of the commit. Please also include the oneline summary of
173the commit, to make it easier for reviewers to know what it is about. 169the commit, to make it easier for reviewers to know what it is about.
174Example: 170Example::
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
187If your patch fixes a bug in a specific commit, e.g. you found an issue using 183If your patch fixes a bug in a specific commit, e.g. you found an issue using
188git-bisect, please use the 'Fixes:' tag with the first 12 characters of the 184git-bisect, please use the 'Fixes:' tag with the first 12 characters of the
189SHA-1 ID, and the one line summary. For example: 185SHA-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
193The following git-config settings can be used to add a pretty format for 189The following git-config settings can be used to add a pretty format for
194outputting the above style in the git log or git show commands 190outputting 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
2013) Separate your changes. 197.. _split_changes:
202------------------------- 198
1993) Separate your changes
200------------------------
203 201
204Separate each _logical change_ into a separate patch. 202Separate each **logical change** into a separate patch.
205 203
206For example, if your changes include both bug fixes and performance 204For example, if your changes include both bug fixes and performance
207enhancements for a single driver, separate those changes into two 205enhancements 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
217on its own merits. 215on its own merits.
218 216
219If one patch depends on another patch in order for a change to be 217If one patch depends on another patch in order for a change to be
220complete, that is OK. Simply note "this patch depends on patch X" 218complete, that is OK. Simply note **"this patch depends on patch X"**
221in your patch description. 219in your patch description.
222 220
223When dividing your change into a series of patches, take special care to 221When dividing your change into a series of patches, take special care to
224ensure that the kernel builds and runs properly after each patch in the 222ensure that the kernel builds and runs properly after each patch in the
225series. Developers using "git bisect" to track down a problem can end up 223series. Developers using ``git bisect`` to track down a problem can end up
226splitting your patch series at any point; they will not thank you if you 224splitting your patch series at any point; they will not thank you if you
227introduce bugs in the middle. 225introduce 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
2344) Style-check your changes. 2324) Style-check your changes
235---------------------------- 233---------------------------
236 234
237Check your patch for basic style violations, details of which can be 235Check your patch for basic style violations, details of which can be
238found in Documentation/CodingStyle. Failure to do so simply wastes 236found 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
260patch. 258patch.
261 259
262 260
2635) Select the recipients for your patch. 2615) Select the recipients for your patch
264---------------------------------------- 262---------------------------------------
265 263
266You should always copy the appropriate subsystem maintainer(s) on any patch 264You should always copy the appropriate subsystem maintainer(s) on any patch
267to code that they maintain; look through the MAINTAINERS file and the 265to 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,
295obviously, the patch should not be sent to any public lists. 293obviously, the patch should not be sent to any public lists.
296 294
297Patches that fix a severe bug in a released kernel should be directed 295Patches that fix a severe bug in a released kernel should be directed
298toward the stable maintainers by putting a line like this: 296toward 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
312maintainer (as listed in the MAINTAINERS file) a man-pages patch, or at 310maintainer (as listed in the MAINTAINERS file) a man-pages patch, or at
313least a notification of the change, so that some information makes its way 311least a notification of the change, so that some information makes its way
314into the manual pages. User-space API changes should also be copied to 312into the manual pages. User-space API changes should also be copied to
315linux-api@vger.kernel.org. 313linux-api@vger.kernel.org.
316 314
317For small patches you may want to CC the Trivial Patch Monkey 315For small patches you may want to CC the Trivial Patch Monkey
318trivial@kernel.org which collects "trivial" patches. Have a look 316trivial@kernel.org which collects "trivial" patches. Have a look
319into the MAINTAINERS file for its current manager. 317into the MAINTAINERS file for its current manager.
318
320Trivial patches must qualify for one of the following rules: 319Trivial 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
3356) No MIME, no links, no compression, no attachments. Just plain text. 3356) No MIME, no links, no compression, no attachments. Just plain text
336----------------------------------------------------------------------- 336----------------------------------------------------------------------
337 337
338Linus and other kernel developers need to be able to read and comment 338Linus and other kernel developers need to be able to read and comment
339on the changes you are submitting. It is important for a kernel 339on the changes you are submitting. It is important for a kernel
@@ -356,8 +356,8 @@ you to re-send them using MIME.
356See Documentation/email-clients.txt for hints about configuring 356See Documentation/email-clients.txt for hints about configuring
357your e-mail client so that it sends your patches untouched. 357your e-mail client so that it sends your patches untouched.
358 358
3597) E-mail size. 3597) E-mail size
360--------------- 360--------------
361 361
362Large changes are not appropriate for mailing lists, and some 362Large changes are not appropriate for mailing lists, and some
363maintainers. If your patch, uncompressed, exceeds 300 kB in size, 363maintainers. 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
366that if your patch exceeds 300 kB, it almost certainly needs to be broken up 366that if your patch exceeds 300 kB, it almost certainly needs to be broken up
367anyway. 367anyway.
368 368
3698) Respond to review comments. 3698) Respond to review comments
370------------------------------ 370-----------------------------
371 371
372Your patch will almost certainly get comments from reviewers on ways in 372Your patch will almost certainly get comments from reviewers on ways in
373which the patch can be improved. You must respond to those comments; 373which 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
382politely and address the problems they have pointed out. 382politely and address the problems they have pointed out.
383 383
384 384
3859) Don't get discouraged - or impatient. 3859) Don't get discouraged - or impatient
386---------------------------------------- 386---------------------------------------
387 387
388After you have submitted your change, be patient and wait. Reviewers are 388After you have submitted your change, be patient and wait. Reviewers are
389busy people and may not get to your patch right away. 389busy 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
419pass it on as an open-source patch. The rules are pretty simple: if you 419pass it on as an open-source patch. The rules are pretty simple: if you
420can certify the below: 420can certify the below:
421 421
422 Developer's Certificate of Origin 1.1 422Developer's Certificate of Origin 1.1
423^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
423 424
424 By making a contribution to this project, I certify that: 425By 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
448then you just add a line saying 449then 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
466the nature of your changes. While there is nothing mandatory about this, it 467the nature of your changes. While there is nothing mandatory about this, it
467seems like prepending the description with your mail and/or name, all 468seems like prepending the description with your mail and/or name, all
468enclosed in square brackets, is noticeable enough to make it obvious that 469enclosed in square brackets, is noticeable enough to make it obvious that
469you are responsible for last-minute changes. Example : 470you 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.
481Special note to back-porters: It seems to be a common and useful practice 482Special note to back-porters: It seems to be a common and useful practice
482to insert an indication of the origin of a patch at the top of the commit 483to insert an indication of the origin of a patch at the top of the commit
483message (just after the subject line) to facilitate tracking. For instance, 484message (just after the subject line) to facilitate tracking. For instance,
484here's what we see in a 3.x-stable release: 485here's what we see in a 3.x-stable release::
485 486
486Date: 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
492And here's what might appear in an older kernel once a patch is backported: 493And 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
529list archives. 530list archives.
530 531
531If a person has had the opportunity to comment on a patch, but has not 532If a person has had the opportunity to comment on a patch, but has not
532provided such comments, you may optionally add a "Cc:" tag to the patch. 533provided such comments, you may optionally add a ``Cc:`` tag to the patch.
533This is the only tag which might be added without an explicit action by the 534This is the only tag which might be added without an explicit action by the
534person it names - but it should indicate that this person was copied on the 535person it names - but it should indicate that this person was copied on the
535patch. This tag documents that potentially interested parties 536patch. This tag documents that potentially interested parties
@@ -552,11 +553,12 @@ future patches, and ensures credit for the testers.
552Reviewed-by:, instead, indicates that the patch has been reviewed and found 553Reviewed-by:, instead, indicates that the patch has been reviewed and found
553acceptable according to the Reviewer's Statement: 554acceptable according to the Reviewer's Statement:
554 555
555 Reviewer's statement of oversight 556Reviewer's statement of oversight
557^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
556 558
557 By offering my Reviewed-by: tag, I state that: 559By 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
594is used to make it easy to determine where a bug originated, which can help 596is used to make it easy to determine where a bug originated, which can help
595review a bug fix. This tag also assists the stable kernel team in determining 597review a bug fix. This tag also assists the stable kernel team in determining
596which stable kernel versions should receive your fix. This is the preferred 598which stable kernel versions should receive your fix. This is the preferred
597method for indicating a bug fixed by the patch. See #2 above for more details. 599method for indicating a bug fixed by the patch. See :ref:`describe_changes`
600for more details.
598 601
599 602
60014) The canonical patch format 60314) 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
603This section describes how the patch itself should be formatted. Note 606This section describes how the patch itself should be formatted. Note
604that, if you have your patches stored in a git repository, proper patch 607that, if you have your patches stored in a git repository, proper patch
605formatting can be had with "git format-patch". The tools cannot create 608formatting can be had with ``git format-patch``. The tools cannot create
606the necessary text, though, so read the instructions below anyway. 609the necessary text, though, so read the instructions below anyway.
607 610
608The canonical patch subject line is: 611The 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
612The canonical patch message body contains the following: 615The 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
633support that - since because the sequence number is zero-padded, 636support that - since because the sequence number is zero-padded,
634the numerical and alphabetic sort is the same. 637the numerical and alphabetic sort is the same.
635 638
636The "subsystem" in the email's Subject should identify which 639The ``subsystem`` in the email's Subject should identify which
637area or subsystem of the kernel is being patched. 640area or subsystem of the kernel is being patched.
638 641
639The "summary phrase" in the email's Subject should concisely 642The ``summary phrase`` in the email's Subject should concisely
640describe the patch which that email contains. The "summary 643describe the patch which that email contains. The ``summary
641phrase" should not be a filename. Do not use the same "summary 644phrase`` should not be a filename. Do not use the same ``summary
642phrase" for every patch in a whole patch series (where a "patch 645phrase`` for every patch in a whole patch series (where a ``patch
643series" is an ordered sequence of multiple, related patches). 646series`` is an ordered sequence of multiple, related patches).
644 647
645Bear in mind that the "summary phrase" of your email becomes a 648Bear in mind that the ``summary phrase`` of your email becomes a
646globally-unique identifier for that patch. It propagates all the way 649globally-unique identifier for that patch. It propagates all the way
647into the git changelog. The "summary phrase" may later be used in 650into the git changelog. The ``summary phrase`` may later be used in
648developer discussions which refer to the patch. People will want to 651developer discussions which refer to the patch. People will want to
649google for the "summary phrase" to read discussion regarding that 652google for the ``summary phrase`` to read discussion regarding that
650patch. It will also be the only thing that people may quickly see 653patch. It will also be the only thing that people may quickly see
651when, two or three months later, they are going through perhaps 654when, two or three months later, they are going through perhaps
652thousands of patches using tools such as "gitk" or "git log 655thousands of patches using tools such as ``gitk`` or "git log
653--oneline". 656--oneline".
654 657
655For these reasons, the "summary" must be no more than 70-75 658For these reasons, the ``summary`` must be no more than 70-75
656characters, and it must describe both what the patch changes, as well 659characters, and it must describe both what the patch changes, as well
657as why the patch might be necessary. It is challenging to be both 660as why the patch might be necessary. It is challenging to be both
658succinct and descriptive, but that is what a well-written summary 661succinct and descriptive, but that is what a well-written summary
659should do. 662should do.
660 663
661The "summary phrase" may be prefixed by tags enclosed in square 664The ``summary phrase`` may be prefixed by tags enclosed in square
662brackets: "Subject: [PATCH <tag>...] <summary phrase>". The tags are 665brackets: "Subject: [PATCH <tag>...] <summary phrase>". The tags are
663not considered part of the summary phrase, but describe how the patch 666not considered part of the summary phrase, but describe how the patch
664should be treated. Common tags might include a version descriptor if 667should 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
670applied and that they have reviewed or applied all of the patches in 673applied and that they have reviewed or applied all of the patches in
671the patch series. 674the patch series.
672 675
673A couple of example Subjects: 676A 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
678The "from" line must be the very first line in the message body, 681The ``from`` line must be the very first line in the message body,
679and has the form: 682and has the form:
680 683
681 From: Original Author <author@example.com> 684 From: Original Author <author@example.com>
682 685
683The "from" line specifies who will be credited as the author of the 686The ``from`` line specifies who will be credited as the author of the
684patch in the permanent changelog. If the "from" line is missing, 687patch in the permanent changelog. If the ``from`` line is missing,
685then the "From:" line from the email header will be used to determine 688then the ``From:`` line from the email header will be used to determine
686the patch author in the changelog. 689the patch author in the changelog.
687 690
688The explanation body will be committed to the permanent source 691The explanation body will be committed to the permanent source
@@ -694,23 +697,23 @@ especially useful for people who might be searching the commit logs
694looking for the applicable patch. If a patch fixes a compile failure, 697looking for the applicable patch. If a patch fixes a compile failure,
695it may not be necessary to include _all_ of the compile failures; just 698it may not be necessary to include _all_ of the compile failures; just
696enough that it is likely that someone searching for the patch can find 699enough that it is likely that someone searching for the patch can find
697it. As in the "summary phrase", it is important to be both succinct as 700it. As in the ``summary phrase``, it is important to be both succinct as
698well as descriptive. 701well as descriptive.
699 702
700The "---" marker line serves the essential purpose of marking for patch 703The ``---`` marker line serves the essential purpose of marking for patch
701handling tools where the changelog message ends. 704handling tools where the changelog message ends.
702 705
703One good use for the additional comments after the "---" marker is for 706One good use for the additional comments after the ``---`` marker is for
704a diffstat, to show what files have changed, and the number of 707a diffstat, to show what files have changed, and the number of
705inserted and deleted lines per file. A diffstat is especially useful 708inserted and deleted lines per file. A diffstat is especially useful
706on bigger patches. Other comments relevant only to the moment or the 709on bigger patches. Other comments relevant only to the moment or the
707maintainer, not suitable for the permanent changelog, should also go 710maintainer, not suitable for the permanent changelog, should also go
708here. A good example of such comments might be "patch changelogs" 711here. A good example of such comments might be ``patch changelogs``
709which describe what has changed between the v1 and v2 version of the 712which describe what has changed between the v1 and v2 version of the
710patch. 713patch.
711 714
712If you are going to include a diffstat after the "---" marker, please 715If you are going to include a diffstat after the ``---`` marker, please
713use diffstat options "-p 1 -w 70" so that filenames are listed from 716use diffstat options ``-p 1 -w 70`` so that filenames are listed from
714the top of the kernel source tree and don't use too much horizontal 717the top of the kernel source tree and don't use too much horizontal
715space (easily fit in 80 columns, maybe with some indentation). (git 718space (easily fit in 80 columns, maybe with some indentation). (git
716generates appropriate diffstats by default.) 719generates appropriate diffstats by default.)
@@ -718,11 +721,13 @@ generates appropriate diffstats by default.)
718See more details on the proper patch format in the following 721See more details on the proper patch format in the following
719references. 722references.
720 723
724.. _explicit_in_reply_to:
725
72115) Explicit In-Reply-To headers 72615) Explicit In-Reply-To headers
722-------------------------------- 727--------------------------------
723 728
724It can be helpful to manually add In-Reply-To: headers to a patch 729It 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
726previous relevant discussion, e.g. to link a bug fix to the email with 731previous relevant discussion, e.g. to link a bug fix to the email with
727the bug report. However, for a multi-patch series, it is generally 732the bug report. However, for a multi-patch series, it is generally
728best to avoid using In-Reply-To: to link to older versions of the 733best 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
732the cover email text) to link to an earlier version of the patch series. 737the cover email text) to link to an earlier version of the patch series.
733 738
734 739
73516) Sending "git pull" requests 74016) Sending ``git pull`` requests
736------------------------------- 741---------------------------------
737 742
738If you have a series of patches, it may be most convenient to have the 743If you have a series of patches, it may be most convenient to have the
739maintainer pull them directly into the subsystem repository with a 744maintainer 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
741requires a higher degree of trust than taking patches from a mailing list. 746requires a higher degree of trust than taking patches from a mailing list.
742As a result, many subsystem maintainers are reluctant to take pull 747As a result, many subsystem maintainers are reluctant to take pull
743requests, especially from new, unknown developers. If in doubt you can use 748requests, 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
747A pull request should have [GIT] or [PULL] in the subject line. The 752A pull request should have [GIT] or [PULL] in the subject line. The
748request itself should include the repository name and the branch of 753request itself should include the repository name and the branch of
749interest on a single line; it should look something like: 754interest 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
757A pull request should also include an overall message saying what will be 762A pull request should also include an overall message saying what will be
758included in the request, a "git shortlog" listing of the patches 763included in the request, a ``git shortlog`` listing of the patches
759themselves, and a diffstat showing the overall effect of the patch series. 764themselves, and a diffstat showing the overall effect of the patch series.
760The easiest way to get all this information together is, of course, to let 765The easiest way to get all this information together is, of course, to let
761git do it for you with the "git request-pull" command. 766git do it for you with the ``git request-pull`` command.
762 767
763Some maintainers (including Linus) want to see pull requests from signed 768Some maintainers (including Linus) want to see pull requests from signed
764commits; that increases their confidence that the request actually came 769commits; 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
771be a good way to find developers who can sign your key. 776be a good way to find developers who can sign your key.
772 777
773Once you have prepared a patch series in git that you wish to have somebody 778Once you have prepared a patch series in git that you wish to have somebody
774pull, create a signed tag with "git tag -s". This will create a new tag 779pull, create a signed tag with ``git tag -s``. This will create a new tag
775identifying the last commit in the series and containing a signature 780identifying the last commit in the series and containing a signature
776created with your private key. You will also have the opportunity to add a 781created with your private key. You will also have the opportunity to add a
777changelog-style message to the tag; this is an ideal place to describe the 782changelog-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
782public tree. 787public tree.
783 788
784When generating your pull request, use the signed tag as the target. A 789When generating your pull request, use the signed tag as the target. A
785command like this will do the trick: 790command 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---------------------- 795REFERENCES
791SECTION 2 - REFERENCES 796**********
792----------------------
793 797
794Andrew Morton, "The perfect patch" (tpp). 798Andrew 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--