Skip to content

Commit

Permalink
send-email: initial_to and initial_reply_to are both optional
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Stephen Boyd authored and Junio C Hamano committed Sep 6, 2012
1 parent 51bbccf commit 6183749
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions git-send-email.perl
Original file line number Diff line number Diff line change
Expand Up @@ -759,7 +759,8 @@ sub file_declares_8bit_cte {
}

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

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

0 comments on commit 6183749

Please sign in to comment.