Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Documentation/git-send-email.txt5
-rwxr-xr-xgit-send-email.perl2
-rwxr-xr-xt/t9001-send-email.sh10
3 files changed, 14 insertions, 3 deletions
diff --git a/Documentation/git-send-email.txt b/Documentation/git-send-email.txt
index e7cb0e6c71..9902da43c7 100644
--- a/Documentation/git-send-email.txt
+++ b/Documentation/git-send-email.txt
@@ -165,7 +165,7 @@ Automating
Output of this command must be single email address per line.
Default is the value of 'sendemail.cccmd' configuration value.
---[no-]chain-reply-to=<identifier>::
+--[no-]chain-reply-to::
If this is set, each email will be sent as a reply to the previous
email sent. If disabled with "--no-chain-reply-to", all emails after
the first will be sent as replies to the first email sent. When using
@@ -214,7 +214,8 @@ specified, as well as 'body' if --no-signed-off-cc is specified.
--[no-]thread::
If this is set, the In-Reply-To header will be set on each email sent.
If disabled with "--no-thread", no emails will have the In-Reply-To
- header set. Default is the value of the 'sendemail.thread' configuration
+ header set, unless specified with --in-reply-to.
+ Default is the value of the 'sendemail.thread' configuration
value; if that is unspecified, default to --thread.
diff --git a/git-send-email.perl b/git-send-email.perl
index 4a77d445cd..303e03a8ce 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -1150,7 +1150,7 @@ foreach my $t (@files) {
my $message_was_sent = send_message();
# set up for the next message
- if ($message_was_sent &&
+ if ($thread && $message_was_sent &&
($chain_reply_to || !defined $reply_to || length($reply_to) == 0)) {
$reply_to = $message_id;
if (length $references > 0) {
diff --git a/t/t9001-send-email.sh b/t/t9001-send-email.sh
index 8ab1a78bf5..9ce04fd472 100755
--- a/t/t9001-send-email.sh
+++ b/t/t9001-send-email.sh
@@ -621,6 +621,16 @@ test_expect_success 'in-reply-to but no threading' '
grep "In-Reply-To: <in-reply-id@example.com>"
'
+test_expect_success 'no in-reply-to and no threading' '
+ git send-email \
+ --dry-run \
+ --from="Example <nobody@example.com>" \
+ --to=nobody@example.com \
+ --nothread \
+ $patches $patches >stdout &&
+ ! grep "In-Reply-To: " stdout
+'
+
test_expect_success 'threading but no chain-reply-to' '
git send-email \
--dry-run \