Search notes:

The canonical format for Linux kernel patches

This format is defined in Documentation/process/submitting-patches.rst.
A patch consists of
These two parts are separated by --- line.

Change log

The format of the change log is
Possible tag lines include:

Optional comments

The optional comments don't go into the changelog.
Such comments might be used to describe the changes from the previous patch if an unaccepted patch is amended and resubmitted with a new version number ([PATCH v2]…).
The optional comments might also include the output as produced by diffstat -p 1 -w 70.

Patch

The patch itself comes in unified (= diff -u) format.
Adding -p (associated function names with changes) makes it easier for reviewers to read.

Message body

The message body looks like
from: John Doe <jd@somewhere.xyz>

A commit message. This message will be added to the permanent changelog
and describes the patch. It is separated by an empty line from the
preceding from: line.

The from line is only needed if the person sending the patch is different
from the sender's email address. This person will be credited as the
author of the patch.

The message is followed by one or more "signed off" lines and possibly other
tag lines which then is followed by a line containing three hyphens.

Signed-off-by: Donald Duck <dd@disneyland.com>
---
The optional text after the three hyphens won't go into the changelog.
It can be used for additional comments, diffstat etc.
It is followed by the actual diff output:

  arch/arm/boot/dts/keystone.dtsi | 8 ++++++++
  1 file changed, 8 insertions(+)

diff --git a/arch/arm/boot/dts/keystone.dtsi b/arch/arm/boot/dts/keystone.dtsi
index 3f272826f537..007648971744 100644
--- a/arch/arm/boot/dts/keystone.dtsi
--- b/arch/arm/boot/dts/keystone.dtsi

   etc
   etc
--
2.1.0
The summarizing phrase from the Subject becomes a globally-unique identitifier for that patch. It should not be longer than 75 characters.

Sending the patch

The patch is sent to the corresponding maintainers with such a Subject format: [PATCH] subsystem: summarizing phrase.

See also

Documentation/email-clients.txt
The scripts:

Links

http://linux.yyz.us/patch-format.html
https://www.ozlabs.org/~akpm/stuff/tpp.txt
https://lkml.org/lkml/2005/4/7/183

Index