Skip to content

Commit d0e9810

Browse files
Krzysztof Mazurgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 5c80afe commit d0e9810

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

git-send-email.perl

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -851,17 +851,20 @@ sub extract_valid_address_or_die {
851851

852852
sub validate_address {
853853
my $address = shift;
854-
if (!extract_valid_address($address)) {
854+
while (!extract_valid_address($address)) {
855855
print STDERR "error: unable to extract a valid address from: $address\n";
856-
$_ = ask("What to do with this address? ([q]uit|[d]rop): ",
857-
valid_re => qr/^(?:quit|q|drop|d)/i,
856+
$_ = ask("What to do with this address? ([q]uit|[d]rop|[e]dit): ",
857+
valid_re => qr/^(?:quit|q|drop|d|edit|e)/i,
858858
default => 'q');
859859
if (/^d/i) {
860860
return undef;
861861
} elsif (/^q/i) {
862862
cleanup_compose_files();
863863
exit(0);
864864
}
865+
$address = ask("Who should the email be sent to (if any)? ",
866+
default => "",
867+
valid_re => qr/\@.*\./, confirm_only => 1);
865868
}
866869
return $address;
867870
}

0 commit comments

Comments
 (0)