Skip to content

Commit

Permalink
git-send-email: ask what to do with an invalid email address
Browse files Browse the repository at this point in the history
We used to warn about invalid emails and just drop them. Such warnings
can be unnoticed by user or noticed after sending email when we are not
giving the "final sanity check [Y/n]?"

Now we quit by default.

Signed-off-by: Krzysztof Mazur <krzysiek@podlesie.net>
Suggested-by: Junio C Hamano <gitster@pobox.com>
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 e431225 commit 5c80afe
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions git-send-email.perl
Original file line number Diff line number Diff line change
Expand Up @@ -852,8 +852,16 @@ sub extract_valid_address_or_die {
sub validate_address {
my $address = shift;
if (!extract_valid_address($address)) {
print STDERR "W: unable to extract a valid address from: $address\n";
return undef;
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,
default => 'q');
if (/^d/i) {
return undef;
} elsif (/^q/i) {
cleanup_compose_files();
exit(0);
}
}
return $address;
}
Expand Down

0 comments on commit 5c80afe

Please sign in to comment.