diff options
author | Jeff King <peff@peff.net> | 2007-12-17 15:51:34 -0500 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2007-12-17 15:58:05 -0800 |
commit | 4f3d37035a7c735a3b69f962656819f4ff7e4927 (patch) | |
tree | b1a32f9b739c7a2ca9650acce12ec3d6e6566dca /git-send-email.perl | |
parent | 6851162adf29762cd121555645214468451a3111 (diff) | |
download | git-4f3d37035a7c735a3b69f962656819f4ff7e4927.tar.gz git-4f3d37035a7c735a3b69f962656819f4ff7e4927.tar.xz |
git-send-email: avoid duplicate message-ids
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>
Diffstat (limited to 'git-send-email.perl')
-rwxr-xr-x | git-send-email.perl | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/git-send-email.perl b/git-send-email.perl index b03297c9d..e8354c760 100755 --- a/git-send-email.perl +++ b/git-send-email.perl @@ -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} @@ -643,6 +643,9 @@ foreach my $t (@files) { } push @xh, $_; } + elsif (/^Message-Id: (.*)/i) { + $message_id = $1; + } elsif (!/^Date:\s/ && /^[-A-Za-z]+:\s+\S/) { push @xh, $_; } @@ -728,6 +731,7 @@ foreach my $t (@files) { $references = "$message_id"; } } + $message_id = undef; } if ($compose) { |