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

[PATCH] git-send-email.perl: fix In-Reply-To for second and subsequent patches

From
Antonio Ospite <ospite@studenti.unina.it>
Date
Oct 14, 2010, 09:38 UTC
Message-ID
<1287049138-13940-1-git-send-email-ospite@studenti.unina.it>

Make second and subsequent patches appear as replies to the first patch, even when an initial In-Reply-To is supplied; this is the typical behaviour we want when we send a series with cover letter in reply to some discussion, and this is also what the man page says about --in-reply-to.

In order to achieve the old behaviour of a flat structure in reply to something the user can always use "--no-thread --in-reply-to <...>".

Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>
---
Hi,

Right now _all_ the patches appear as reply to the message indicated as initial In-Reply-To, and I think this is not right, the behaviour this patch introduces can be debatable of course, but there are quite some arguments supporting it:

  - When $initial_reply_to is asked to the user, it is asked as the
    "Message-ID to be used as In-Reply-To for the _first_ email", this
    makes me think that the second and subsequent patches are not using
    it and will be considered as reply to the first message or chained
    according to the --[no-]chain-reply-to setting.
  - git-format-patch states that clearly in the man page, and I think
    git-send-email should behave the same way, and this is explained
    also in the git-send-email man page, look at
    --in-reply-to=<identifier> explanation.
Please keep CCing me on this as I am not subscribed to git@vger.kernel.org.
Thanks,
   Antonio Ospite
   http://ao2.it
 git-send-email.perl |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/git-send-email.perl b/git-send-email.perl
index 8cc4161..615a40d 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -1313,7 +1313,7 @@ foreach my $t (@files) {
 
 	# set up for the next message
 	if ($thread && $message_was_sent &&
-		(chain_reply_to() || !defined $reply_to || length($reply_to) == 0)) {
+		($message_num == 1 || chain_reply_to() || !defined $reply_to || length($reply_to) == 0)) {
 		$reply_to = $message_id;
 		if (length $references > 0) {
 			$references .= "\n $message_id";
-- 
1.7.1
Next: Jonathan Nieder
Message 1 of 19 in “git-send-email.perl: fix In-Reply-To for second and subsequent patches”
  1. git-send-email.perl: fix In-Reply-To for second and subsequent patchesAntonio Ospite, Oct 14, 2010
  2. Jonathan NiederOct 14, 2010
  3. Antonio OspiteOct 15, 2010
  4. git-send-email.perl: fix In-Reply-To for second and subsequent patchesAntonio Ospite, Oct 19, 2010
  5. Junio C HamanoOct 19, 2010
  6. Junio C HamanoOct 19, 2010
  7. Antonio OspiteOct 19, 2010
  8. Antonio OspiteOct 26, 2010
  9. git-send-email.perl: make initial In-Reply-To apply only to first emailAntonio Ospite, Nov 5, 2010
  10. Matthieu MoyNov 5, 2010
  11. Junio C HamanoNov 9, 2010
  12. Antonio OspiteNov 10, 2010
  13. Junio C HamanoNov 10, 2010
  14. [PATCHi v4] git-send-email.perl: make initial In-Reply-To apply only to first emailAntonio Ospite, Nov 12, 2010
  15. Junio C HamanoNov 12, 2010
  16. Junio C HamanoNov 12, 2010
  17. Antonio OspiteNov 12, 2010
  18. Jonathan NiederNov 5, 2010
  19. Antonio OspiteNov 8, 2010

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.