Skip to content

Commit 15dc3b9

Browse files
chrissicoolgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent b604954 commit 15dc3b9

File tree

1 file changed

+19
-19
lines changed

1 file changed

+19
-19
lines changed

git-send-email.perl

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -166,13 +166,13 @@ sub format_2822_time {
166166

167167
# Variables we fill in automatically, or via prompting:
168168
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,
170170
$author,$sender,$smtp_authpass,$annotate,$use_xmailer,$compose,$time);
171171

172172
my $envelope_sender;
173173

174174
# Example reply to:
175-
#$initial_reply_to = ''; #<[email protected]>';
175+
#$initial_in_reply_to = ''; #<[email protected]>';
176176

177177
my $repo = eval { Git->repository() };
178178
my @repo = $repo ? ($repo) : ();
@@ -314,7 +314,7 @@ sub signal_handler {
314314
if !$help and $dump_aliases and @ARGV;
315315
$rc = GetOptions(
316316
"sender|from=s" => \$sender,
317-
"in-reply-to=s" => \$initial_reply_to,
317+
"in-reply-to=s" => \$initial_in_reply_to,
318318
"subject=s" => \$initial_subject,
319319
"to=s" => \@initial_to,
320320
"to-cmd=s" => \$to_cmd,
@@ -676,7 +676,7 @@ sub get_patch_subject {
676676

677677
my $tpl_sender = $sender || $repoauthor || $repocommitter || '';
678678
my $tpl_subject = $initial_subject || '';
679-
my $tpl_reply_to = $initial_reply_to || '';
679+
my $tpl_in_reply_to = $initial_in_reply_to || '';
680680

681681
print $c <<EOT1, Git::prefix_lines("GIT: ", __ <<EOT2), <<EOT3;
682682
From $tpl_sender # This line is ignored.
@@ -689,7 +689,7 @@ sub get_patch_subject {
689689
EOT2
690690
From: $tpl_sender
691691
Subject: $tpl_subject
692-
In-Reply-To: $tpl_reply_to
692+
In-Reply-To: $tpl_in_reply_to
693693
694694
EOT3
695695
for my $f (@files) {
@@ -728,7 +728,7 @@ sub get_patch_subject {
728728
$sender = delete($parsed_email{'From'});
729729
}
730730
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'});
732732
}
733733
if ($parsed_email{'Subject'}) {
734734
$initial_subject = delete($parsed_email{'Subject'});
@@ -911,16 +911,16 @@ sub expand_one_alias {
911911
@initial_cc = process_address_list(@initial_cc);
912912
@bcclist = process_address_list(@bcclist);
913913

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(
916916
__("Message-ID to be used as In-Reply-To for the first email (if any)? "),
917917
default => "",
918918
valid_re => qr/\@.*\./, confirm_only => 1);
919919
}
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 '';
924924
}
925925

926926
if (!defined $smtp_server) {
@@ -940,7 +940,7 @@ sub expand_one_alias {
940940
}
941941

942942
# 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,
944944
$needs_confirm, $message_num, $ask_default);
945945

946946
sub extract_valid_address {
@@ -1349,9 +1349,9 @@ sub send_message {
13491349
if ($use_xmailer) {
13501350
$header .= "X-Mailer: git-send-email $gitversion\n";
13511351
}
1352-
if ($reply_to) {
1352+
if ($in_reply_to) {
13531353

1354-
$header .= "In-Reply-To: $reply_to\n";
1354+
$header .= "In-Reply-To: $in_reply_to\n";
13551355
$header .= "References: $references\n";
13561356
}
13571357
if (@xh) {
@@ -1528,8 +1528,8 @@ sub send_message {
15281528
return 1;
15291529
}
15301530

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 || '';
15331533
$subject = $initial_subject;
15341534
$message_num = 0;
15351535

@@ -1739,9 +1739,9 @@ sub send_message {
17391739

17401740
# set up for the next message
17411741
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 ||
17431743
$message_num == 1)) {
1744-
$reply_to = $message_id;
1744+
$in_reply_to = $message_id;
17451745
if (length $references > 0) {
17461746
$references .= "\n $message_id";
17471747
} else {

0 commit comments

Comments
 (0)