Skip to content

Commit 6183749

Browse files
bebarinogitster
authored andcommitted
send-email: initial_to and initial_reply_to are both optional
We may pick up additional recipients from the format-patch output files we are sending, in which case it is perfectly valid to leave the @initial_to empty when the prompt asks. We may want to start a new discussion thread without replying to anything, and it is valid to leave $initial_reply_to empty. An earlier update to avoid [email protected] stuffed in address fields did not take these two cases into account. Signed-off-by: Stephen Boyd <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 51bbccf commit 6183749

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

git-send-email.perl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -759,7 +759,8 @@ sub file_declares_8bit_cte {
759759
}
760760

761761
if (!@initial_to && !defined $to_cmd) {
762-
my $to = ask("Who should the emails be sent to? ",
762+
my $to = ask("Who should the emails be sent to (if any)? ",
763+
default => "",
763764
valid_re => qr/\@.*\./, confirm_only => 1);
764765
push @initial_to, parse_address_line($to) if defined $to; # sanitized/validated later
765766
$prompting++;
@@ -786,7 +787,8 @@ sub expand_one_alias {
786787

787788
if ($thread && !defined $initial_reply_to && $prompting) {
788789
$initial_reply_to = ask(
789-
"Message-ID to be used as In-Reply-To for the first email? ",
790+
"Message-ID to be used as In-Reply-To for the first email (if any)? ",
791+
default => "",
790792
valid_re => qr/\@.*\./, confirm_only => 1);
791793
}
792794
if (defined $initial_reply_to) {

0 commit comments

Comments
 (0)