@matheusbsbs / matheus-bagliano / commits / 7ccf79274c
Fork 0

git-send-email: Add References: headers to emails, in addition to In-Reply-To:

Signed-off-by: Ryan Anderson <rda@google.com> Signed-off-by: Junio C Hamano <junkio@cox.net>

Ryan Anderson committed May 29, 2006 at 12:30 UTC 7ccf79274c03971b8884223b1950077582a7bf8a
1 file changed +11 -2
git-send-email.perl
+11 -2
@@ -303,7 +303,7 @@ EOT
303 }
304
305 # Variables we set as part of the loop over files
306 -our ($message_id, $cc, %mail, $subject, $reply_to, $message);
306 +our ($message_id, $cc, %mail, $subject, $reply_to, $references, $message);
307
308 sub extract_valid_address {
309 my $address = shift;
@@ -367,7 +367,11 @@ Date: $date
367 Message-Id: $message_id
368 X-Mailer: git-send-email $gitversion
369 ";
370 - $header .= "In-Reply-To: $reply_to\n" if $reply_to;
370 + if ($reply_to) {
371 +
372 + $header .= "In-Reply-To: $reply_to\n";
373 + $header .= "References: $references\n";
374 + }
375
376 if ($smtp_server =~ m#^/#) {
377 my $pid = open my $sm, '|-';
@@ -482,6 +486,11 @@ foreach my $t (@files) {
486 # set up for the next message
487 if ($chain_reply_to || length($reply_to) == 0) {
488 $reply_to = $message_id;
489 + if (length $references > 0) {
490 + $references .= " $message_id";
491 + } else {
492 + $references = "$message_id";
493 + }
494 }
495 make_message_id();
496 }