Skip to content

Commit 95a877a

Browse files
committed
Merge branch 'mh/maint-fix-send-email-threaded' into mh/fix-send-email-threaded
* mh/maint-fix-send-email-threaded: doc/send-email: clarify the behavior of --in-reply-to with --no-thread send-email: fix non-threaded mails add a test for git-send-email for non-threaded mails Conflicts: git-send-email.perl t/t9001-send-email.sh
2 parents a1b5b37 + 0fd41f2 commit 95a877a

File tree

3 files changed

+14
-3
lines changed

3 files changed

+14
-3
lines changed

Documentation/git-send-email.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ Automating
165165
Output of this command must be single email address per line.
166166
Default is the value of 'sendemail.cccmd' configuration value.
167167

168-
--[no-]chain-reply-to=<identifier>::
168+
--[no-]chain-reply-to::
169169
If this is set, each email will be sent as a reply to the previous
170170
email sent. If disabled with "--no-chain-reply-to", all emails after
171171
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.
214214
--[no-]thread::
215215
If this is set, the In-Reply-To header will be set on each email sent.
216216
If disabled with "--no-thread", no emails will have the In-Reply-To
217-
header set. Default is the value of the 'sendemail.thread' configuration
217+
header set, unless specified with --in-reply-to.
218+
Default is the value of the 'sendemail.thread' configuration
218219
value; if that is unspecified, default to --thread.
219220

220221

git-send-email.perl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1150,7 +1150,7 @@ sub send_message
11501150
my $message_was_sent = send_message();
11511151

11521152
# set up for the next message
1153-
if ($message_was_sent &&
1153+
if ($thread && $message_was_sent &&
11541154
($chain_reply_to || !defined $reply_to || length($reply_to) == 0)) {
11551155
$reply_to = $message_id;
11561156
if (length $references > 0) {

t/t9001-send-email.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -621,6 +621,16 @@ test_expect_success 'in-reply-to but no threading' '
621621
grep "In-Reply-To: <[email protected]>"
622622
'
623623

624+
test_expect_success 'no in-reply-to and no threading' '
625+
git send-email \
626+
--dry-run \
627+
--from="Example <[email protected]>" \
628+
629+
--nothread \
630+
$patches $patches >stdout &&
631+
! grep "In-Reply-To: " stdout
632+
'
633+
624634
test_expect_success 'threading but no chain-reply-to' '
625635
git send-email \
626636
--dry-run \

0 commit comments

Comments
 (0)