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

[RFC PATCH] format-patch: thread as reply to cover letter even with in-reply-to

From
Thomas Rast <trast@student.ethz.ch>
Date
Feb 16, 2009, 19:00 UTC
Message-ID
<1234810812-30499-1-git-send-email-trast@student.ethz.ch>
In-Reply-To
<cover.1234801852.git.trast@student.ethz.ch>

Currently, format-patch --thread --cover-letter --in-reply-to $parent makes all mails, including the cover letter, a reply to $parent. However, we would want the reader to consider the cover letter above all the patches.

This changes the semantics so that only the cover letter is a reply to $parent, while all the patches are formatted as replies to the cover letter.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
---
Thomas Rast wrote:
Show 5 quoted lines
> Unrelated note regarding --thread usage:
> 
> Wouldn't it be better if format-patch made it so that the cover
> letter, if any, is the (only) reply to the --in-reply-to, and all
> actual patches are replies to the cover letter?
Maybe like this?
 builtin-log.c |   20 +++++++++++++++-----
 1 files changed, 15 insertions(+), 5 deletions(-)
diff --git a/builtin-log.c b/builtin-log.c
index 2ae39af..ec11f95 100644
--- a/builtin-log.c
+++ b/builtin-log.c
@@ -1031,12 +1031,22 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
 			/* Have we already had a message ID? */
 			if (rev.message_id) {
 				/*
-				 * If we've got the ID to be a reply
-				 * to, discard the current ID;
-				 * otherwise, make everything a reply
-				 * to that.
+				 * Without --cover-letter and
+				 * --in-reply-to, make every mail a
+				 * reply to the one before.
+				 *
+				 * With --in-reply-to but no
+				 * --cover-letter, make every mail a
+				 * reply to the <reply-to>.
+				 *
+				 * With --cover-letter, make every
+				 * mail but the cover letter a reply
+				 * to the cover letter.  The cover
+				 * letter is a reply to the
+				 * --in-reply-to, if specified.
 				 */
-				if (rev.ref_message_id)
+				if (rev.ref_message_id
+				    && (!cover_letter || rev.nr > 1))
 					free(rev.message_id);
 				else
 					rev.ref_message_id = rev.message_id;
-- 
1.6.2.rc0.328.g2c702
Previous: Thomas RastNext: Jay Soffian
Message 6 of 26 in “bash completion: offer more options for gitk”
  1. bash completion: offer more options for gitkThomas Rast, Feb 14, 2009
  2. Junio C HamanoFeb 15, 2009
  3. Santi BéjarFeb 15, 2009
  4. 0/2 bash completion: more options for gitk/log/shortlogThomas Rast, Feb 16, 2009
  5. Thomas RastFeb 16, 2009
  6. format-patch: thread as reply to cover letter even with in-reply-toThomas Rast, Feb 16, 2009
  7. Jay SoffianFeb 16, 2009
  8. Thomas RastFeb 16, 2009
  9. Jakub NarebskiFeb 16, 2009
  10. Thomas RastFeb 16, 2009
  11. 0/4 format-patch --cover-letter --in-reply-toThomas Rast, Feb 19, 2009
  12. 1/4 format-patch: threading test reactivationThomas Rast, Feb 19, 2009
  13. 2/4 format-patch: track several referencesThomas Rast, Feb 19, 2009
  14. Daniel BarkalowFeb 19, 2009
  15. 0/4 format-patch --cover-letter --in-reply-toThomas Rast, Feb 20, 2009
  16. 1/4 format-patch: threading test reactivationThomas Rast, Feb 20, 2009
  17. 2/4 format-patch: track several referencesThomas Rast, Feb 20, 2009
  18. 3/4 format-patch: thread as reply to cover letter even with in-reply-toThomas Rast, Feb 20, 2009
  19. 4/4 format-patch: support deep threadingThomas Rast, Feb 20, 2009
  20. Junio C HamanoFeb 22, 2009
  21. 3/4 format-patch: thread as reply to cover letter even with in-reply-toThomas Rast, Feb 19, 2009
  22. 4/4 format-patch: support deep threadingThomas Rast, Feb 19, 2009
  23. 1/2 bash completion: refactor common log, shortlog and gitk optionsThomas Rast, Feb 16, 2009
  24. 2/2 bash completion: only show 'log --merge' if mergingThomas Rast, Feb 16, 2009
  25. Shawn O. PearceFeb 18, 2009
  26. Junio C HamanoFeb 18, 2009

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.