Skip to content

Commit

Permalink
git-send-email: allow edit invalid email address
Browse files Browse the repository at this point in the history
In some cases the user may want to send email with "Cc:" line with
email address we cannot extract. Now we allow user to extract
such email address for us.

Signed-off-by: Krzysztof Mazur <krzysiek@podlesie.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Krzysztof Mazur authored and Junio C Hamano committed Nov 26, 2012
1 parent 5c80afe commit d0e9810
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions git-send-email.perl
Original file line number Diff line number Diff line change
Expand Up @@ -851,17 +851,20 @@ sub extract_valid_address_or_die {

sub validate_address {
my $address = shift;
if (!extract_valid_address($address)) {
while (!extract_valid_address($address)) {
print STDERR "error: unable to extract a valid address from: $address\n";
$_ = ask("What to do with this address? ([q]uit|[d]rop): ",
valid_re => qr/^(?:quit|q|drop|d)/i,
$_ = ask("What to do with this address? ([q]uit|[d]rop|[e]dit): ",
valid_re => qr/^(?:quit|q|drop|d|edit|e)/i,
default => 'q');
if (/^d/i) {
return undef;
} elsif (/^q/i) {
cleanup_compose_files();
exit(0);
}
$address = ask("Who should the email be sent to (if any)? ",
default => "",
valid_re => qr/\@.*\./, confirm_only => 1);
}
return $address;
}
Expand Down

0 comments on commit d0e9810

Please sign in to comment.