send-email: rename variable for clarity

The SMTP protocol has both, the 'Reply-To' and the 'In-Reply-To' header fields. We only use the latter. To avoid confusion, rename the variable for it. Signed-off-by: Christian Ludwig <chrissicool@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Christian Ludwig committed Mar 4, 2018 at 00:58 UTC 15dc3b9161dad12e37d74863d0ab5d94b661a936
1 file changed +19 -19
git-send-email.perl
+19 -19
@@ -166,13 +166,13 @@ my $re_encoded_word = qr/=\?($re_token)\?($re_token)\?($re_encoded_text)\?=/;
166
167 # Variables we fill in automatically, or via prompting:
168 my (@to,$no_to,@initial_to,@cc,$no_cc,@initial_cc,@bcclist,$no_bcc,@xh,
169 - $initial_reply_to,$initial_subject,@files,
169 + $initial_in_reply_to,$initial_subject,@files,
170 $author,$sender,$smtp_authpass,$annotate,$use_xmailer,$compose,$time);
171
172 my $envelope_sender;
173
174 # Example reply to:
175 -#$initial_reply_to = ''; #<20050203173208.GA23964@foobar.com>';
175 +#$initial_in_reply_to = ''; #<20050203173208.GA23964@foobar.com>';
176
177 my $repo = eval { Git->repository() };
178 my @repo = $repo ? ($repo) : ();
@@ -314,7 +314,7 @@ die __("--dump-aliases incompatible with other options\n")
314 if !$help and $dump_aliases and @ARGV;
315 $rc = GetOptions(
316 "sender|from=s" => \$sender,
317 - "in-reply-to=s" => \$initial_reply_to,
317 + "in-reply-to=s" => \$initial_in_reply_to,
318 "subject=s" => \$initial_subject,
319 "to=s" => \@initial_to,
320 "to-cmd=s" => \$to_cmd,
@@ -676,7 +676,7 @@ if ($compose) {
676
677 my $tpl_sender = $sender || $repoauthor || $repocommitter || '';
678 my $tpl_subject = $initial_subject || '';
679 - my $tpl_reply_to = $initial_reply_to || '';
679 + my $tpl_in_reply_to = $initial_in_reply_to || '';
680
681 print $c <<EOT1, Git::prefix_lines("GIT: ", __ <<EOT2), <<EOT3;
682 From $tpl_sender # This line is ignored.
@@ -689,7 +689,7 @@ Clear the body content if you don't wish to send a summary.
689 EOT2
690 From: $tpl_sender
691 Subject: $tpl_subject
692 -In-Reply-To: $tpl_reply_to
692 +In-Reply-To: $tpl_in_reply_to
693
694 EOT3
695 for my $f (@files) {
@@ -728,7 +728,7 @@ EOT3
728 $sender = delete($parsed_email{'From'});
729 }
730 if ($parsed_email{'In-Reply-To'}) {
731 - $initial_reply_to = delete($parsed_email{'In-Reply-To'});
731 + $initial_in_reply_to = delete($parsed_email{'In-Reply-To'});
732 }
733 if ($parsed_email{'Subject'}) {
734 $initial_subject = delete($parsed_email{'Subject'});
@@ -911,16 +911,16 @@ sub expand_one_alias {
911 @initial_cc = process_address_list(@initial_cc);
912 @bcclist = process_address_list(@bcclist);
913
914 -if ($thread && !defined $initial_reply_to && $prompting) {
915 - $initial_reply_to = ask(
914 +if ($thread && !defined $initial_in_reply_to && $prompting) {
915 + $initial_in_reply_to = ask(
916 __("Message-ID to be used as In-Reply-To for the first email (if any)? "),
917 default => "",
918 valid_re => qr/\@.*\./, confirm_only => 1);
919 }
920 -if (defined $initial_reply_to) {
921 - $initial_reply_to =~ s/^\s*<?//;
922 - $initial_reply_to =~ s/>?\s*$//;
923 - $initial_reply_to = "<$initial_reply_to>" if $initial_reply_to ne '';
920 +if (defined $initial_in_reply_to) {
921 + $initial_in_reply_to =~ s/^\s*<?//;
922 + $initial_in_reply_to =~ s/>?\s*$//;
923 + $initial_in_reply_to = "<$initial_in_reply_to>" if $initial_in_reply_to ne '';
924 }
925
926 if (!defined $smtp_server) {
@@ -940,7 +940,7 @@ if ($compose && $compose > 0) {
940 }
941
942 # Variables we set as part of the loop over files
943 -our ($message_id, %mail, $subject, $reply_to, $references, $message,
943 +our ($message_id, %mail, $subject, $in_reply_to, $references, $message,
944 $needs_confirm, $message_num, $ask_default);
945
946 sub extract_valid_address {
@@ -1349,9 +1349,9 @@ Message-Id: $message_id
1349 if ($use_xmailer) {
1350 $header .= "X-Mailer: git-send-email $gitversion\n";
1351 }
1352 - if ($reply_to) {
1352 + if ($in_reply_to) {
1353
1354 - $header .= "In-Reply-To: $reply_to\n";
1354 + $header .= "In-Reply-To: $in_reply_to\n";
1355 $header .= "References: $references\n";
1356 }
1357 if (@xh) {
@@ -1528,8 +1528,8 @@ EOF
1528 return 1;
1529 }
1530
1531 -$reply_to = $initial_reply_to;
1532 -$references = $initial_reply_to || '';
1531 +$in_reply_to = $initial_in_reply_to;
1532 +$references = $initial_in_reply_to || '';
1533 $subject = $initial_subject;
1534 $message_num = 0;
1535
@@ -1739,9 +1739,9 @@ foreach my $t (@files) {
1739
1740 # set up for the next message
1741 if ($thread && $message_was_sent &&
1742 - ($chain_reply_to || !defined $reply_to || length($reply_to) == 0 ||
1742 + ($chain_reply_to || !defined $in_reply_to || length($in_reply_to) == 0 ||
1743 $message_num == 1)) {
1744 - $reply_to = $message_id;
1744 + $in_reply_to = $message_id;
1745 if (length $references > 0) {
1746 $references .= "\n $message_id";
1747 } else {