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

[PATCH 2/2] send-email: fix threaded mails without chain-reply-to

From
Markus Heidelberg <markus.heidelberg@web.de>
Date
Jun 7, 2009, 15:20 UTC
Message-ID
<1244388019-12763-2-git-send-email-markus.heidelberg@web.de>
In-Reply-To
<1244388019-12763-1-git-send-email-markus.heidelberg@web.de>
These commands didn't send threaded mails anymore:
    $ git format-patch <revision range>
    $ git send-email --thread --no-chain-reply-to <files>

This regression was introduced in commit 15da108 ("send-email: 'References:' should only reference what is sent", 2009-04-13) by a hidden code style change:

    ! defined $reply_to || length($reply_to) == 0
was changed to
    not defined $reply_to || length($reply_to) == 0
which is
    not (defined $reply_to || length($reply_to) == 0)
instead of
    (not defined $reply_to) || (length($reply_to) == 0)
Signed-off-by: Markus Heidelberg <markus.heidelberg@web.de>
---
 git-send-email.perl   |    2 +-
 t/t9001-send-email.sh |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/git-send-email.perl b/git-send-email.perl
index 3d6a982..c914bff 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -1142,7 +1142,7 @@ foreach my $t (@files) {
 	my $message_was_sent = send_message();
 
 	# set up for the next message
-	if ($message_was_sent and $chain_reply_to || not defined $reply_to || length($reply_to) == 0) {
+	if ($message_was_sent and $chain_reply_to || !defined $reply_to || length($reply_to) == 0) {
 		$reply_to = $message_id;
 		if (length $references > 0) {
 			$references .= "\n $message_id";
diff --git a/t/t9001-send-email.sh b/t/t9001-send-email.sh
index 576bbd3..bb03aa4 100755
--- a/t/t9001-send-email.sh
+++ b/t/t9001-send-email.sh
@@ -621,7 +621,7 @@ test_expect_success 'in-reply-to but no threading' '
 	grep "In-Reply-To: <in-reply-id@example.com>"
 '
 
-test_expect_failure 'threading but no chain-reply-to' '
+test_expect_success 'threading but no chain-reply-to' '
 	git send-email \
 		--dry-run \
 		--from="Example <nobody@example.com>" \
-- 
1.6.3.2.216.g24c61
Previous: Markus HeidelbergNext: Junio C Hamano
Message 4 of 9 in “enhancements for the context menu of the Rev list”
  1. 0/4 enhancements for the context menu of the Rev listMarkus Heidelberg, Jun 6, 2009
  2. Markus HeidelbergJun 6, 2009
  3. 1/2 add a test case for threaded mails without chain-reply-toMarkus Heidelberg, Jun 7, 2009
  4. 2/2 send-email: fix threaded mails without chain-reply-toMarkus Heidelberg, Jun 7, 2009
  5. Junio C HamanoJun 7, 2009
  6. Markus HeidelbergJun 7, 2009
  7. add a test case for threaded mails without chain-reply-toMarkus Heidelberg, Jun 7, 2009
  8. Markus HeidelbergJun 7, 2009
  9. Marco CostalbaJun 6, 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.