summaryrefslogtreecommitdiff
path: root/git-send-email.perl
diff options
context:
space:
mode:
authorKrzysztof Mazur <krzysiek@podlesie.net>2012-11-22 18:12:11 (GMT)
committerJunio C Hamano <gitster@pobox.com>2012-11-26 23:49:12 (GMT)
commit5c80afed02e1a5ffa4c164e8810aca8c8d655701 (patch)
tree2bfe65f1fc7e1650e0dc8c4c687c4eeec18e1098 /git-send-email.perl
parente43122556912b02ec00746c4b528d7408da9a70f (diff)
downloadgit-5c80afed02e1a5ffa4c164e8810aca8c8d655701.zip
git-5c80afed02e1a5ffa4c164e8810aca8c8d655701.tar.gz
git-5c80afed02e1a5ffa4c164e8810aca8c8d655701.tar.bz2
git-send-email: ask what to do with an invalid email address
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>
Diffstat (limited to 'git-send-email.perl')
-rwxr-xr-xgit-send-email.perl12
1 files changed, 10 insertions, 2 deletions
diff --git a/git-send-email.perl b/git-send-email.perl
index 5a783ac..11a6e86 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -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;
}