Skip to content

Commit 852a15d

Browse files
committed
send-email: ask confirmation if given encoding name is very short
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 <[email protected]>
1 parent 3d8a54e commit 852a15d

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

git-send-email.perl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -733,6 +733,7 @@ sub file_declares_8bit_cte {
733733
print " $f\n";
734734
}
735735
$auto_8bit_encoding = ask("Which 8bit encoding should I declare [UTF-8]? ",
736+
valid_re => qr/.{4}/, confirm_only => 1,
736737
default => "UTF-8");
737738
}
738739

0 commit comments

Comments
 (0)