diff options
author | Junio C Hamano <gitster@pobox.com> | 2015-02-13 12:20:25 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2015-02-13 12:20:25 -0800 |
commit | 852a15d748034eec87adbee73a72689c8936fb8b (patch) | |
tree | d34d57afb2750003823c0bdb155664af200c84f3 /git-send-email.perl | |
parent | 3d8a54eb37d298c251c0b6823dc06935a611bc33 (diff) | |
download | git-852a15d748034eec87adbee73a72689c8936fb8b.tar.gz |
send-email: ask confirmation if given encoding name is very shortjc/send-email-sensible-encoding
Sometimes people respond "y<ENTER>" (or "yes<ENTER>") when asked
this question:
Which 8bit encoding should I declare [UTF-8]?
We already have a mechanism to avoid accepting a mistyped e-mail
address (we ask to confirm when the given address lacks "@" in it);
reuse it to trigger the same confirmation when given a very short
answer. As a typical charset name is probably at least 4 chars or
longer (e.g. "UTF8" spelled without the dash, or "Big5"), this would
prevent such a mistake.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-send-email.perl')
-rwxr-xr-x | git-send-email.perl | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/git-send-email.perl b/git-send-email.perl index fdb0029b59..eb32371151 100755 --- a/git-send-email.perl +++ b/git-send-email.perl @@ -733,6 +733,7 @@ if (!defined $auto_8bit_encoding && scalar %broken_encoding) { print " $f\n"; } $auto_8bit_encoding = ask("Which 8bit encoding should I declare [UTF-8]? ", + valid_re => qr/.{4}/, confirm_only => 1, default => "UTF-8"); } |