git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Markus Heidelberg <markus.heidelberg@web.de>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org, Thomas Rast <trast@student.ethz.ch>,
	Michael Witten <mfwitten@gmail.com>
Subject: [PATCH v2 5/6] send-email: fix non-threaded mails
Date: Mon, 8 Jun 2009 08:43:56 +0200	[thread overview]
Message-ID: <200906080843.57069.markus.heidelberg@web.de> (raw)
In-Reply-To: <1244410857-920-6-git-send-email-markus.heidelberg@web.de>

After commit 3e0c4ff (send-email: respect in-reply-to regardless of
threading, 2009-03-01) the variable $thread was only used for prompting
for an "In-Reply-To", but not for controlling whether the "In-Reply-To"
and "References" fields should be written into the email.

Thus these fields were always used beginning with the second mail and it
was not possible to produce non-threaded mails anymore until commit
15da108 ("send-email: 'References:' should only reference what is sent",
2009-04-13), which introduced a regression with the side effect to make
it possible again when --no-chain-reply-to was set.

Signed-off-by: Markus Heidelberg <markus.heidelberg@web.de>
---

Differences to v1:
* patch context in the test:
  "git send-email" instead of "!git send-email"

 git-send-email.perl   |    5 ++++-
 t/t9001-send-email.sh |    2 +-
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/git-send-email.perl b/git-send-email.perl
index c11a245..be63ea7 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -1142,7 +1142,10 @@ foreach my $t (@files) {
 	my $message_was_sent = send_message();
 
 	# set up for the next message
-	if ($message_was_sent and $chain_reply_to || !defined $reply_to || length($reply_to) == 0) {
+	if ($message_was_sent and $thread and
+			$chain_reply_to || !defined $reply_to || length($reply_to) == 0) {
+		# with --chain-reply-to every time
+		# else only after the first mail (and only if --in-reply-to was not specified)
 		$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 4a4fa7f..87bbbe7 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 'no in-reply-to and no threading' '
+test_expect_success 'no in-reply-to and no threading' '
 	git send-email \
 		--dry-run \
 		--from="Example <nobody@example.com>" \
-- 
1.6.3.2.220.gb421

  reply	other threads:[~2009-06-08  6:45 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-07 21:40 [PATCH 0/6] fixes for git-send-email Markus Heidelberg
2009-06-07 21:40 ` [PATCH 1/6] send-email: fix a typo in a comment Markus Heidelberg
2009-06-08 21:44   ` Junio C Hamano
2009-06-09  7:05     ` Markus Heidelberg
2009-06-09  7:11       ` [PATCH 1/2] add a test for git-send-email for non-threaded mails Markus Heidelberg
2009-06-09  7:11       ` [PATCH 2/2] send-email: fix " Markus Heidelberg
2009-06-07 21:40 ` [PATCH 2/6] add a test for git-send-email for threaded mails without chain-reply-to Markus Heidelberg
2009-06-07 23:28   ` Junio C Hamano
2009-06-08  5:47     ` Markus Heidelberg
2009-06-08  6:37       ` [PATCH v2 " Markus Heidelberg
2009-06-08  6:57         ` Junio C Hamano
2009-06-07 21:40 ` [PATCH 3/6] send-email: fix " Markus Heidelberg
2009-06-10  5:51   ` Junio C Hamano
2009-06-10  7:15     ` [RF sanity check] send-email threading fixes (was Re: [PATCH 3/6] send-email: fix threaded mails without chain-reply-to) Junio C Hamano
2009-06-11 16:49       ` Markus Heidelberg
2009-06-11 20:38         ` [RF sanity check] send-email threading fixes Junio C Hamano
2009-06-11 22:49           ` Markus Heidelberg
2009-06-11 23:21             ` Junio C Hamano
2009-06-12 10:49               ` [PATCH 0/6] " Markus Heidelberg
2009-06-12 10:51                 ` [PATCH 1/6] add a test for git-send-email for non-threaded mails Markus Heidelberg
2009-06-12 10:51                 ` [PATCH 2/6] send-email: fix " Markus Heidelberg
2009-06-12 10:51                 ` [PATCH 3/6] doc/send-email: clarify the behavior of --in-reply-to with --no-thread Markus Heidelberg
2009-06-12 10:51                 ` [PATCH 4/6] add a test for git-send-email for threaded mails without chain-reply-to Markus Heidelberg
2009-06-12 10:51                 ` [PATCH 5/6] send-email: fix " Markus Heidelberg
2009-06-12 10:51                 ` [PATCH 6/6] send-email: fix a typo in a comment Markus Heidelberg
2009-06-10  7:16     ` [PATCH 1/6] add a test for git-send-email for non-threaded mails Junio C Hamano
2009-06-10  7:16     ` [PATCH 2/6] send-email: fix " Junio C Hamano
2009-06-10  7:16     ` [PATCH 3/6] doc/send-email: clarify the behavior of --in-reply-to with --no-thread Junio C Hamano
2009-06-10  7:17     ` [PATCH 4/6] send-email: fix threaded mails without chain-reply-to Junio C Hamano
2009-06-10  7:17     ` [PATCH 5/6] add a test for git-send-email for " Junio C Hamano
2009-06-10  7:17     ` [PATCH 6/6] send-email: fix a typo in a comment Junio C Hamano
2009-06-07 21:40 ` [PATCH 4/6] add a test for git-send-email for non-threaded mails Markus Heidelberg
2009-06-08  6:41   ` [PATCH v2 " Markus Heidelberg
2009-06-08  7:00     ` Junio C Hamano
2009-06-08  7:13       ` [PATCH v3 " Markus Heidelberg
2009-06-07 21:40 ` [PATCH 5/6] send-email: fix " Markus Heidelberg
2009-06-08  6:43   ` Markus Heidelberg [this message]
2009-06-07 21:40 ` [PATCH 6/6] doc/send-email: clarify the behavior of --in-reply-to with --no-thread Markus Heidelberg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200906080843.57069.markus.heidelberg@web.de \
    --to=markus.heidelberg@web.de \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=mfwitten@gmail.com \
    --cc=trast@student.ethz.ch \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).