From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33443) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YNUF9-0003hH-Ty for qemu-devel@nongnu.org; Mon, 16 Feb 2015 17:34:20 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YNUF6-0002MB-NL for qemu-devel@nongnu.org; Mon, 16 Feb 2015 17:34:19 -0500 Received: from pb-smtp1.int.icgroup.com ([208.72.237.35]:58814 helo=sasl.smtp.pobox.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YNUF6-0002M4-JT for qemu-devel@nongnu.org; Mon, 16 Feb 2015 17:34:16 -0500 From: Junio C Hamano References: <20150205114914.GA10126@stefanha-thinkpad.redhat.com> <54D38B73.4060803@redhat.com> <20150205195758.GC15326@peff.net> <20150206193349.GB4220@peff.net> References: <20150205114914.GA10126@stefanha-thinkpad.redhat.com> <54D38B73.4060803@redhat.com> <20150205195758.GC15326@peff.net> Date: Mon, 16 Feb 2015 14:34:14 -0800 In-Reply-To: <20150206193349.GB4220@peff.net> (Jeff King's message of "Fri, 6 Feb 2015 14:33:49 -0500") Message-ID: MIME-Version: 1.0 Content-Type: text/plain Subject: [Qemu-devel] [PATCH] send-email: ask confirmation if given encoding name is very short List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: git@vger.kernel.org Cc: Zhu Guihua , Stefan Hajnoczi , qemu-devel@nongnu.org, tangchen@cn.fujitsu.com, Jeff King , guz.fnst@cn.fujitsu.com, isimatu.yasuaki@jp.fujitsu.com, Geert Uytterhoeven , anshul.makkar@profitbricks.com, chen.fan.fnst@cn.fujitsu.com, imammedo@redhat.com, afaerber@suse.de Sometimes people respond "y" (or "yes") 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 --- * 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