qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH] send-email: ask confirmation if given encoding name


From: Junio C Hamano
Subject: [Qemu-devel] [PATCH] send-email: ask confirmation if given encoding name is very short
Date: Mon, 16 Feb 2015 14:34:14 -0800
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)

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 <address@hidden>
---

 * Will mark to be merged to 'next'.

 git-send-email.perl | 1 +
 1 file changed, 1 insertion(+)

diff --git a/git-send-email.perl b/git-send-email.perl
index fdb0029..eb32371 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -733,6 +733,7 @@ sub file_declares_8bit_cte {
                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");
 }
 
-- 
2.3.0-282-gf18c841




reply via email to

[Prev in Thread] Current Thread [Next in Thread]