git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH/RFC] Documentation/format-patch: summarize patch-sending workflow

From
Jonathan Nieder <jrnieder@gmail.com>
Date
Apr 13, 2011, 22:17 UTC
Message-ID
<20110413221736.GA773@elie>
In-Reply-To
<87mxjtn8x7.fsf@rho.meyering.net>
Hi Jim,
Jim Meyering wrote:
Show 5 quoted lines
> I hope I haven't caused Junio or anyone else undue trouble.
> I know well how format-patch output can be used, but in the vast
> majority of patch-including messages I send, I include format-patch
> output mainly as an FYI, *following* commentary that does not
> belong in the log, so it's ok there -- desirable, even.

Sure, that's true. The main problem with including a patch in mbox format inline is that the "From " line tends to get corrupted. How about something like patch?

-- 8< --
Subject: Documentation/format-patch: summarize patch-sending workflow

Add a DISCUSSION section to encourage people to send patches in a form that can be applied by "git am" automatically. There are two such forms:

 1. The default form in which most metadata goes in the mail header
    and the message body starts with the patch description;
 2. The snipsnip form in which a message starts with pertinent
    discussion and ends with a patch after a "scissors" mark.

While at it, include a pointer to Documentation/SubmittingPatches for MUA-specific hints.

Inspired-by: Jim Meyering <jim@meyering.net>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
---
 Documentation/git-format-patch.txt |   48 +++++++++++++++++++++++++++++++++++-
 1 files changed, 47 insertions(+), 1 deletions(-)
diff --git a/Documentation/git-format-patch.txt b/Documentation/git-format-patch.txt
index a5525e9..5118fdb 100644
--- a/Documentation/git-format-patch.txt
+++ b/Documentation/git-format-patch.txt
@@ -274,9 +274,55 @@ as e-mailable patches:
 $ git format-patch -3
 ------------
 
+DISCUSSION
+----------
+The patch produced by 'git format-patch' is in UNIX mailbox format,
+like so:
+
+------------
+From f97e66080296c741200eacf1eaeb73f05b19e140 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?=C3=86var=20Arnfj=C3=B6r=C3=B0=20Bjarmason?= <avarab@gmail.com>
+Date: Sun, 10 Apr 2011 19:37:01 +0000
+Subject: [PATCH] Makefile: extract Q_() source strings as ngettext()
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+The patch adding the Q_() wrapper function around ngettext[1] didn't
+contain a corresponding update to the "pot" target in the Makefile. As
+...
+------------
+
+Typically it will be placed in a MUA's drafts folder, edited to add
+timely commentary that should not go in the changelog after the three
+dashes, and then sent as a message whose body starts with "The patch
+adding the Q_() wrapper function ...".  On the receiving end, readers
+can save interesting patches in a UNIX mailbox and apply them with
+linkgit:git-am[1].
+
+'git am --scissors' accepts an alternative format with the patch
+inline in the message:
+
+------------
+...
+> So we should do such-and-such.
+
+Makes sense to me.  How about this patch?
+
+-- 8< --
+From: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
+Subject: Makefile: extract Q_() source strings as ngettext()
+
+The patch adding the Q_() wrapper function around ngettext[1] didn't
+....
+------------
+
+See linkgit:git-am[1] for details.
+
 SEE ALSO
 --------
-linkgit:git-am[1], linkgit:git-send-email[1]
+linkgit:git-am[1], linkgit:git-send-email[1], linkgit:git-imap-send[1],
+Documentation/SubmittingPatches
 
 GIT
 ---
-- 
1.7.5.rc0
Previous: Jim MeyeringNext: Junio C Hamano
Message 4 of 26 in “remove doubled words, e.g., s/to to/to/, and fix related typos”
  1. remove doubled words, e.g., s/to to/to/, and fix related typosJim Meyering, Apr 13, 2011
  2. Drew NorthupApr 13, 2011
  3. Jim MeyeringApr 13, 2011
  4. Documentation/format-patch: summarize patch-sending workflowJonathan Nieder, Apr 13, 2011
  5. Junio C HamanoApr 13, 2011
  6. Documentation: summarize how format-patch output is consumedJonathan Nieder, Apr 14, 2011
  7. Junio C HamanoApr 14, 2011
  8. 0/5 Documentation/format-patch: more hints on submitting patchesJonathan Nieder, Apr 15, 2011
  9. 1/5 Documentation: describe the format of messages with inline patchesJonathan Nieder, Apr 15, 2011
  10. Drew NorthupApr 15, 2011
  11. Junio C HamanoApr 15, 2011
  12. 2/5 Documentation: explain how to check for patch corruptionJonathan Nieder, Apr 15, 2011
  13. Junio C HamanoApr 15, 2011
  14. Jonathan NiederApr 15, 2011
  15. 3/5 Documentation: hints for sending patches inline with ThunderbirdJonathan Nieder, Apr 15, 2011
  16. 4/5 Documentation: publicize KMail hints for sending patches inlineJonathan Nieder, Apr 15, 2011
  17. Michele BallabioApr 17, 2011
  18. 5/5 Documentation: publicize hints for sending patches with GMailJonathan Nieder, Apr 15, 2011
  19. 6/5 Documentation/format-patch: suggest Toggle Word Wrap add-on for ThunderbirdJohannes Sixt, Apr 15, 2011
  20. Junio C HamanoApr 15, 2011
  21. Michael J GruberApr 15, 2011
  22. Junio C HamanoApr 15, 2011
  23. Jonathan NiederApr 15, 2011
  24. 6/5 Documentation/format-patch: suggest Toggle Word Wrap add-on for ThunderbirdJohannes Sixt, Apr 18, 2011
  25. Jakub NarebskiApr 13, 2011
  26. Junio C HamanoApr 13, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.