Skip to content

Commit

Permalink
git-send-email: avoid duplicate message-ids
Browse files Browse the repository at this point in the history
We used to unconditionally add a message-id to the outgoing
email without bothering to check if it already had one.
Instead, let's use the existing one.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Jeff King authored and Junio C Hamano committed Dec 17, 2007
1 parent 6851162 commit 4f3d370
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion git-send-email.perl
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,7 @@ sub send_message
$ccline = "\nCc: $cc";
}
my $sanitized_sender = sanitize_address($sender);
make_message_id();
make_message_id() unless defined($message_id);

my $header = "From: $sanitized_sender
To: $to${ccline}
Expand Down Expand Up @@ -643,6 +643,9 @@ sub send_message
}
push @xh, $_;
}
elsif (/^Message-Id: (.*)/i) {
$message_id = $1;
}
elsif (!/^Date:\s/ && /^[-A-Za-z]+:\s+\S/) {
push @xh, $_;
}
Expand Down Expand Up @@ -728,6 +731,7 @@ sub send_message
$references = "$message_id";
}
}
$message_id = undef;
}

if ($compose) {
Expand Down

0 comments on commit 4f3d370

Please sign in to comment.