summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKrzysztof Mazur <krzysiek@podlesie.net>2012-11-22 19:12:12 +0100
committerJunio C Hamano <gitster@pobox.com>2012-11-26 15:49:12 -0800
commitd0e98107bac36af7526fdb5c080ce9dfb56161ce (patch)
treecdac7da34d3c9187dc14e03c53e41d31a5402d5c
parent5c80afed02e1a5ffa4c164e8810aca8c8d655701 (diff)
downloadgit-d0e98107bac36af7526fdb5c080ce9dfb56161ce.tar.gz
git-send-email: allow edit invalid email address
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>
-rwxr-xr-xgit-send-email.perl9
1 files changed, 6 insertions, 3 deletions
diff --git a/git-send-email.perl b/git-send-email.perl
index 11a6e86823..f3bbc166d6 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -851,10 +851,10 @@ 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;
@@ -862,6 +862,9 @@ sub validate_address {
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;
}