Skip to content

Commit 9b2c767

Browse files
mchehabJonathan Corbet
authored andcommitted
Documentation/SubmittingPatches: enrich the Sphinx output
Do a few changes to make the output look better: - use bullets on trivial patches list; - use monotonic font for tools name; - use :manpage:`foo` for man pages; - don't put all references to maintainer*html at the same line. Signed-off-by: Mauro Carvalho Chehab <[email protected]> Signed-off-by: Jonathan Corbet <[email protected]>
1 parent 5903019 commit 9b2c767

File tree

1 file changed

+55
-45
lines changed

1 file changed

+55
-45
lines changed

Documentation/SubmittingPatches

Lines changed: 55 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ submitting code. If you are submitting a driver, also read
1515
Documentation/SubmittingDrivers; for device tree binding patches, read
1616
Documentation/devicetree/bindings/submitting-patches.txt.
1717

18-
Many of these steps describe the default behavior of the git version
19-
control system; if you use git to prepare your patches, you'll find much
18+
Many of these steps describe the default behavior of the ``git`` version
19+
control system; if you use ``git`` to prepare your patches, you'll find much
2020
of the mechanical work done for you, though you'll still need to prepare
21-
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
2222
your life as a kernel developer easier.
2323

2424
Creating and Sending your Change
@@ -29,7 +29,7 @@ Creating and Sending your Change
2929
-------------------------------
3030

3131
If you do not have a repository with the current kernel source handy, use
32-
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,
3333
which can be grabbed with::
3434

3535
git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
@@ -48,13 +48,14 @@ in the next section), but that is the hard way to do kernel development.
4848

4949
If you must generate your patches by hand, use ``diff -up`` or ``diff -uprN``
5050
to create patches. Git generates patches in this form by default; if
51-
you're using git, you can skip this section entirely.
51+
you're using ``git``, you can skip this section entirely.
5252

5353
All changes to the Linux kernel occur in the form of patches, as
54-
generated by diff(1). When creating your patch, make sure to create it
55-
in "unified diff" format, as supplied by the ``-u`` argument to diff(1).
54+
generated by :manpage:`diff(1)`. When creating your patch, make sure to
55+
create it in "unified diff" format, as supplied by the ``-u`` argument
56+
to :manpage:`diff(1)`.
5657
Also, please use the ``-p`` argument which shows which C function each
57-
change is in - that makes the resultant diff a lot easier to read.
58+
change is in - that makes the resultant ``diff`` a lot easier to read.
5859
Patches should be based in the root kernel source directory,
5960
not in any lower subdirectory.
6061

@@ -70,7 +71,7 @@ To create a patch for a single file, it is often sufficient to do::
7071
diff -up $SRCTREE/$MYFILE{.orig,} > /tmp/patch
7172

7273
To create a patch for multiple files, you should unpack a "vanilla",
73-
or unmodified kernel source tree, and generate a diff against your
74+
or unmodified kernel source tree, and generate a ``diff`` against your
7475
own source tree. For example::
7576

7677
MYSRC= /devel/linux
@@ -81,20 +82,20 @@ own source tree. For example::
8182
linux-3.19-vanilla $MYSRC > /tmp/patch
8283

8384
``dontdiff`` is a list of files which are generated by the kernel during
84-
the build process, and should be ignored in any diff(1)-generated
85+
the build process, and should be ignored in any :manpage:`diff(1)`-generated
8586
patch.
8687

8788
Make sure your patch does not include any extra files which do not
8889
belong in a patch submission. Make sure to review your patch -after-
89-
generating it with diff(1), to ensure accuracy.
90+
generating it with :manpage:`diff(1)`, to ensure accuracy.
9091

9192
If your changes produce a lot of deltas, you need to split them into
9293
individual patches which modify things in logical stages; see
9394
:ref:`split_changes`. This will facilitate review by other kernel developers,
9495
very important if you want your patch accepted.
9596

96-
If you're using git, ``git rebase -i`` can help you with this process. If
97-
you're not using git, quilt <http://savannah.nongnu.org/projects/quilt>
97+
If you're using ``git``, ``git rebase -i`` can help you with this process. If
98+
you're not using ``git``, ``quilt`` <http://savannah.nongnu.org/projects/quilt>
9899
is another popular alternative.
99100

100101
.. _describe_changes:
@@ -133,7 +134,7 @@ as you intend it to.
133134

134135
The maintainer will thank you if you write your patch description in a
135136
form which can be easily pulled into Linux's source code management
136-
system, git, as a "commit log". See :ref:`explicit_in_reply_to`.
137+
system, ``git``, as a "commit log". See :ref:`explicit_in_reply_to`.
137138

138139
Solve only one problem per patch. If your description starts to get
139140
long, that's a sign that you probably need to split up your patch.
@@ -156,7 +157,7 @@ its behaviour.
156157
If the patch fixes a logged bug entry, refer to that bug entry by
157158
number and URL. If the patch follows from a mailing list discussion,
158159
give a URL to the mailing list archive; use the https://lkml.kernel.org/
159-
redirector with a Message-Id, to ensure that the links cannot become
160+
redirector with a ``Message-Id``, to ensure that the links cannot become
160161
stale.
161162

162163
However, try to make your explanation understandable without external
@@ -181,13 +182,13 @@ there is no collision with your six-character ID now, that condition may
181182
change five years from now.
182183

183184
If your patch fixes a bug in a specific commit, e.g. you found an issue using
184-
git-bisect, please use the 'Fixes:' tag with the first 12 characters of the
185-
SHA-1 ID, and the one line summary. For example::
185+
``git bisect``, please use the 'Fixes:' tag with the first 12 characters of
186+
the SHA-1 ID, and the one line summary. For example::
186187

187188
Fixes: e21d2170f366 ("video: remove unnecessary platform_set_drvdata()")
188189

189-
The following git-config settings can be used to add a pretty format for
190-
outputting the above style in the git log or git show commands::
190+
The following ``git config`` settings can be used to add a pretty format for
191+
outputting the above style in the ``git log`` or ``git show`` commands::
191192

192193
[core]
193194
abbrev = 12
@@ -318,17 +319,17 @@ into the MAINTAINERS file for its current manager.
318319

319320
Trivial patches must qualify for one of the following rules:
320321

321-
Spelling fixes in documentation
322-
Spelling fixes for errors which could break grep(1)
323-
Warning fixes (cluttering with useless warnings is bad)
324-
Compilation fixes (only if they are actually correct)
325-
Runtime fixes (only if they actually fix things)
326-
Removing use of deprecated functions/macros
327-
Contact detail and documentation fixes
328-
Non-portable code replaced by portable code (even in arch-specific,
329-
since people copy, as long as it's trivial)
330-
Any fix by the author/maintainer of the file (ie. patch monkey
331-
in re-transmission mode)
322+
- Spelling fixes in documentation
323+
- Spelling fixes for errors which could break :manpage:`grep(1)`
324+
- Warning fixes (cluttering with useless warnings is bad)
325+
- Compilation fixes (only if they are actually correct)
326+
- Runtime fixes (only if they actually fix things)
327+
- Removing use of deprecated functions/macros
328+
- Contact detail and documentation fixes
329+
- Non-portable code replaced by portable code (even in arch-specific,
330+
since people copy, as long as it's trivial)
331+
- Any fix by the author/maintainer of the file (ie. patch monkey
332+
in re-transmission mode)
332333

333334

334335

@@ -341,8 +342,11 @@ developer to be able to "quote" your changes, using standard e-mail
341342
tools, so that they may comment on specific portions of your code.
342343

343344
For this reason, all patches should be submitted by e-mail "inline".
344-
WARNING: Be wary of your editor's word-wrap corrupting your patch,
345-
if you choose to cut-n-paste your patch.
345+
346+
.. warning::
347+
348+
Be wary of your editor's word-wrap corrupting your patch,
349+
if you choose to cut-n-paste your patch.
346350

347351
Do not attach the patch as a MIME attachment, compressed or not.
348352
Many popular e-mail applications will not always transmit a MIME
@@ -604,7 +608,7 @@ for more details.
604608
------------------------------
605609

606610
This section describes how the patch itself should be formatted. Note
607-
that, if you have your patches stored in a git repository, proper patch
611+
that, if you have your patches stored in a ``git`` repository, proper patch
608612
formatting can be had with ``git format-patch``. The tools cannot create
609613
the necessary text, though, so read the instructions below anyway.
610614

@@ -629,7 +633,7 @@ The canonical patch message body contains the following:
629633

630634
- Any additional comments not suitable for the changelog.
631635

632-
- The actual patch (diff output).
636+
- The actual patch (``diff`` output).
633637

634638
The Subject line format makes it very easy to sort the emails
635639
alphabetically by subject line - pretty much any email reader will
@@ -647,13 +651,13 @@ series`` is an ordered sequence of multiple, related patches).
647651

648652
Bear in mind that the ``summary phrase`` of your email becomes a
649653
globally-unique identifier for that patch. It propagates all the way
650-
into the git changelog. The ``summary phrase`` may later be used in
654+
into the ``git`` changelog. The ``summary phrase`` may later be used in
651655
developer discussions which refer to the patch. People will want to
652656
google for the ``summary phrase`` to read discussion regarding that
653657
patch. It will also be the only thing that people may quickly see
654658
when, two or three months later, they are going through perhaps
655-
thousands of patches using tools such as ``gitk`` or "git log
656-
--oneline".
659+
thousands of patches using tools such as ``gitk`` or ``git log
660+
--oneline``.
657661

658662
For these reasons, the ``summary`` must be no more than 70-75
659663
characters, and it must describe both what the patch changes, as well
@@ -704,18 +708,18 @@ The ``---`` marker line serves the essential purpose of marking for patch
704708
handling tools where the changelog message ends.
705709

706710
One good use for the additional comments after the ``---`` marker is for
707-
a diffstat, to show what files have changed, and the number of
708-
inserted and deleted lines per file. A diffstat is especially useful
711+
a ``diffstat``, to show what files have changed, and the number of
712+
inserted and deleted lines per file. A ``diffstat`` is especially useful
709713
on bigger patches. Other comments relevant only to the moment or the
710714
maintainer, not suitable for the permanent changelog, should also go
711715
here. A good example of such comments might be ``patch changelogs``
712716
which describe what has changed between the v1 and v2 version of the
713717
patch.
714718

715-
If you are going to include a diffstat after the ``---`` marker, please
716-
use diffstat options ``-p 1 -w 70`` so that filenames are listed from
719+
If you are going to include a ``diffstat`` after the ``---`` marker, please
720+
use ``diffstat`` options ``-p 1 -w 70`` so that filenames are listed from
717721
the top of the kernel source tree and don't use too much horizontal
718-
space (easily fit in 80 columns, maybe with some indentation). (git
722+
space (easily fit in 80 columns, maybe with some indentation). (``git``
719723
generates appropriate diffstats by default.)
720724

721725
See more details on the proper patch format in the following
@@ -761,9 +765,9 @@ interest on a single line; it should look something like::
761765

762766
A pull request should also include an overall message saying what will be
763767
included in the request, a ``git shortlog`` listing of the patches
764-
themselves, and a diffstat showing the overall effect of the patch series.
768+
themselves, and a ``diffstat`` showing the overall effect of the patch series.
765769
The easiest way to get all this information together is, of course, to let
766-
git do it for you with the ``git request-pull`` command.
770+
``git`` do it for you with the ``git request-pull`` command.
767771

768772
Some maintainers (including Linus) want to see pull requests from signed
769773
commits; that increases their confidence that the request actually came
@@ -775,7 +779,7 @@ signed by one or more core kernel developers. This step can be hard for
775779
new developers, but there is no way around it. Attending conferences can
776780
be a good way to find developers who can sign your key.
777781

778-
Once you have prepared a patch series in git that you wish to have somebody
782+
Once you have prepared a patch series in ``git`` that you wish to have somebody
779783
pull, create a signed tag with ``git tag -s``. This will create a new tag
780784
identifying the last commit in the series and containing a signature
781785
created with your private key. You will also have the opportunity to add a
@@ -803,10 +807,15 @@ Jeff Garzik, "Linux kernel patch submission format".
803807

804808
Greg Kroah-Hartman, "How to piss off a kernel subsystem maintainer".
805809
<http://www.kroah.com/log/linux/maintainer.html>
810+
806811
<http://www.kroah.com/log/linux/maintainer-02.html>
812+
807813
<http://www.kroah.com/log/linux/maintainer-03.html>
814+
808815
<http://www.kroah.com/log/linux/maintainer-04.html>
816+
809817
<http://www.kroah.com/log/linux/maintainer-05.html>
818+
810819
<http://www.kroah.com/log/linux/maintainer-06.html>
811820

812821
NO!!!! No more huge patch bombs to [email protected] people!
@@ -820,5 +829,6 @@ Linus Torvalds's mail on the canonical patch format:
820829

821830
Andi Kleen, "On submitting kernel patches"
822831
Some strategies to get difficult or controversial changes in.
832+
823833
http://halobates.de/on-submitting-patches.pdf
824834

0 commit comments

Comments
 (0)