From: Drew DeVault <sir@cmpwn.com>
To: linux-doc@vger.kernel.org, Jonathan Corbet <corbet@lwn.net>
Cc: Drew DeVault <sir@cmpwn.com>
Subject: [PATCH 4/4] submitting-patches.rst: presume git will be used
Date: Wed, 2 Sep 2020 11:57:59 -0400 [thread overview]
Message-ID: <20200902155759.55895-5-sir@cmpwn.com> (raw)
In-Reply-To: <20200902155759.55895-1-sir@cmpwn.com>
Git is fairly ubiquitous these days, and the additional information in
this documentation for preparing patches without it is not especially
relevant anymore and may serve to confuse new contributors.
Signed-off-by: Drew DeVault <sir@cmpwn.com>
---
Conflict of interest: I wrote and maintain the website,
git-send-email.io, which is recommended in the revised document.
Documentation/process/submitting-patches.rst | 91 +++++---------------
1 file changed, 22 insertions(+), 69 deletions(-)
diff --git a/Documentation/process/submitting-patches.rst b/Documentation/process/submitting-patches.rst
index dd008b89bca5..4e93e682e7ac 100644
--- a/Documentation/process/submitting-patches.rst
+++ b/Documentation/process/submitting-patches.rst
@@ -18,11 +18,10 @@ submitting code. If you are submitting a driver, also read
for device tree binding patches, read
Documentation/devicetree/bindings/submitting-patches.rst.
-Many of these steps describe the default behavior of the ``git`` version
-control system; if you use ``git`` to prepare your patches, you'll find much
-of the mechanical work done for you, though you'll still need to prepare
-and document a sensible set of patches. In general, use of ``git`` will make
-your life as a kernel developer easier.
+This documentation assumes that you're using ``git`` to prepare your patches.
+If you're unfamiliar with ``git``, you would be well-advised to learn how to
+use it, it will make your life as a kernel developer and in general much
+easier.
Obtain a current source tree
-------------------------------
@@ -39,64 +38,6 @@ patches prepared against those trees. See the **T:** entry for the subsystem
in the MAINTAINERS file to find that tree, or simply ask the maintainer if
the tree is not listed there.
-It is still possible to download kernel releases via tarballs (as described
-in the next section), but that is the hard way to do kernel development.
-
-1) ``diff -up``
----------------
-
-If you must generate your patches by hand, use ``diff -up`` or ``diff -uprN``
-to create patches. Git generates patches in this form by default; if
-you're using ``git``, you can skip this section entirely.
-
-All changes to the Linux kernel occur in the form of patches, as
-generated by :manpage:`diff(1)`. When creating your patch, make sure to
-create it in "unified diff" format, as supplied by the ``-u`` argument
-to :manpage:`diff(1)`.
-Also, please use the ``-p`` argument which shows which C function each
-change is in - that makes the resultant ``diff`` a lot easier to read.
-Patches should be based in the root kernel source directory,
-not in any lower subdirectory.
-
-To create a patch for a single file, it is often sufficient to do::
-
- SRCTREE=linux
- MYFILE=drivers/net/mydriver.c
-
- cd $SRCTREE
- cp $MYFILE $MYFILE.orig
- vi $MYFILE # make your change
- cd ..
- diff -up $SRCTREE/$MYFILE{.orig,} > /tmp/patch
-
-To create a patch for multiple files, you should unpack a "vanilla",
-or unmodified kernel source tree, and generate a ``diff`` against your
-own source tree. For example::
-
- MYSRC=/devel/linux
-
- tar xvfz linux-3.19.tar.gz
- mv linux-3.19 linux-3.19-vanilla
- diff -uprN -X linux-3.19-vanilla/Documentation/dontdiff \
- linux-3.19-vanilla $MYSRC > /tmp/patch
-
-``dontdiff`` is a list of files which are generated by the kernel during
-the build process, and should be ignored in any :manpage:`diff(1)`-generated
-patch.
-
-Make sure your patch does not include any extra files which do not
-belong in a patch submission. Make sure to review your patch -after-
-generating it with :manpage:`diff(1)`, to ensure accuracy.
-
-If your changes produce a lot of deltas, you need to split them into
-individual patches which modify things in logical stages; see
-:ref:`split_changes`. This will facilitate review by other kernel developers,
-very important if you want your patch accepted.
-
-If you're using ``git``, ``git rebase -i`` can help you with this process. If
-you're not using ``git``, ``quilt`` <https://savannah.nongnu.org/projects/quilt>
-is another popular alternative.
-
.. _describe_changes:
Describe your changes
@@ -350,7 +291,12 @@ on the changes you are submitting. It is important for a kernel
developer to be able to "quote" your changes, using standard e-mail
tools, so that they may comment on specific portions of your code.
-For this reason, all patches should be submitted by e-mail "inline".
+For this reason, all patches should be submitted by e-mail "inline". The
+easiest way to do this is with ``git send-email``, which is strongly
+recommended. An interactive tutorial for ``git send-email`` is available at
+https://git-send-email.io.
+
+If you choose not to use ``git send-email``:
.. warning::
@@ -380,13 +326,17 @@ server, and provide instead a URL (link) pointing to your patch. But note
that if your patch exceeds 300 kB, it almost certainly needs to be broken up
anyway.
-8) Respond to review comments
+``git request-pull`` may be used to generate an email which summarizes your changes
+and provides a URL to fetch your tree from. See :ref:`_request_pull`.
+
+Respond to review comments
-----------------------------
Your patch will almost certainly get comments from reviewers on ways in
-which the patch can be improved. You must respond to those comments;
-ignoring reviewers is a good way to get ignored in return. Review comments
-or questions that do not lead to a code change should almost certainly
+which the patch can be improved, in the form of a reply to your email. You must
+respond to those comments; ignoring reviewers is a good way to get ignored in
+return. You can simply reply to their emails to answer their comments. Review
+comments or questions that do not lead to a code change should almost certainly
bring about a comment or changelog entry so that the next reviewer better
understands what is going on.
@@ -421,6 +371,7 @@ convention to prefix your subject line with [PATCH]. This lets Linus
and other kernel developers more easily distinguish patches from other
e-mail discussions.
+``git send-email`` will do this for you automatically.
Sign your work - the Developer's Certificate of Origin
@@ -468,13 +419,14 @@ then you just add a line saying::
Signed-off-by: Random J Developer <random@developer.example.org>
using your real name (sorry, no pseudonyms or anonymous contributions.)
+This will be done for you automatically if you use ``git commit -s``.
Some people also put extra tags at the end. They'll just be ignored for
now, but you can do this to mark internal company procedures or just
point out some special detail about the sign-off.
-12) When to use Acked-by:, Cc:, and Co-developed-by:
+When to use Acked-by:, Cc:, and Co-developed-by:
-------------------------------------------------------
The Signed-off-by: tag indicates that the signer was involved in the
@@ -794,6 +746,7 @@ letter or in the first patch of the series and it should be placed
either below the ``---`` line or at the very bottom of all other
content, right before your email signature.
+.. _request_pull:
Sending ``git pull`` requests
---------------------------------
--
2.28.0
next prev parent reply other threads:[~2020-09-02 15:58 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-02 15:57 [PATCH 0/4] Improvements to submitting-patches.rst Drew DeVault
2020-09-02 15:57 ` [PATCH 1/4] submitting-patches.rst: remove heading numbering Drew DeVault
2020-09-03 15:44 ` Jonathan Corbet
2020-09-03 15:48 ` Drew DeVault
2020-09-03 15:46 ` Jonathan Corbet
2020-09-02 15:57 ` [PATCH 2/4] Documentation/process: expand plain-text advice Drew DeVault
2020-09-02 16:06 ` Randy Dunlap
2020-09-02 16:20 ` Drew DeVault
2020-09-03 15:47 ` Jonathan Corbet
2020-09-02 15:57 ` [PATCH 3/4] Documentation/maintainer: rehome sign-off process Drew DeVault
2020-09-03 15:50 ` Jonathan Corbet
2020-09-02 15:57 ` Drew DeVault [this message]
2020-09-02 16:11 ` [PATCH 4/4] submitting-patches.rst: presume git will be used Randy Dunlap
2020-09-02 16:11 ` Drew DeVault
2020-09-03 15:57 ` Jonathan Corbet
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200902155759.55895-5-sir@cmpwn.com \
--to=sir@cmpwn.com \
--cc=corbet@lwn.net \
--cc=linux-doc@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).