Skip to content

Commit

Permalink
send-email: fix threaded mails without chain-reply-to
Browse files Browse the repository at this point in the history
An earlier commit 15da108 ("send-email: 'References:' should only
reference what is sent", 2009-04-13) broke logic to set up threading
information for the next message by rewriting "!" to "not" without
understanding the precedence rules of the language.

Namely,

    ! 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)

and different from what was intended, which is

    (not defined $reply_to) || (length($reply_to) == 0)

Signed-off-by: Markus Heidelberg <markus.heidelberg@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Markus Heidelberg authored and Junio C Hamano committed Jun 12, 2009
1 parent d67114a commit f74fe34
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion git-send-email.perl
Original file line number Diff line number Diff line change
Expand Up @@ -1150,7 +1150,8 @@ sub send_message
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 &&
($chain_reply_to || !defined $reply_to || length($reply_to) == 0)) {
$reply_to = $message_id;
if (length $references > 0) {
$references .= "\n $message_id";
Expand Down
2 changes: 1 addition & 1 deletion t/t9001-send-email.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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>" \
Expand Down

0 comments on commit f74fe34

Please sign in to comment.