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 y@example.com stuffed in address fields did not take these two cases into account. Signed-off-by: Stephen Boyd <bebarino@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Stephen Boyd committed
Sep 6, 2012 at 11:31 UTC
618374930ab0de78c3994a633ca5f26e286810cf
1 file changed
+4
-2
git-send-email.perl
+4
-2
@@ -759,7 +759,8 @@ if (!defined $sender) {
759
}
760
761
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 => "",
764
valid_re => qr/\@.*\./, confirm_only => 1);
765
push @initial_to, parse_address_line($to) if defined $to; # sanitized/validated later
766
$prompting++;
@@ -786,7 +787,8 @@ sub expand_one_alias {
787
788
if ($thread && !defined $initial_reply_to && $prompting) {
789
$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 => "",
792
valid_re => qr/\@.*\./, confirm_only => 1);
793
}
794
if (defined $initial_reply_to) {