From: Krzysztof Mazur Date: Wed, 24 Oct 2012 08:03:35 +0000 (+0200) Subject: git-send-email: skip RFC2047 quoting for ASCII subjects X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=5637d8573206e8c3d99abacb6b6ca3cf11816202;p=git.git git-send-email: skip RFC2047 quoting for ASCII subjects The git-send-email always use RFC2047 subject quoting for files with "broken" encoding - non-ASCII files without Content-Transfer-Encoding, even for ASCII subjects. This is harmless but unnecessarily ugly for people reading the raw headers. This patch skips rfc2047 quoting when the subject does not need it. Signed-off-by: Krzysztof Mazur Signed-off-by: Jeff King --- diff --git a/git-send-email.perl b/git-send-email.perl index adcb4e397..efeae4c47 100755 --- a/git-send-email.perl +++ b/git-send-email.perl @@ -1327,7 +1327,8 @@ foreach my $t (@files) { $body_encoding = $auto_8bit_encoding; } - if ($broken_encoding{$t} && !is_rfc2047_quoted($subject)) { + if ($broken_encoding{$t} && !is_rfc2047_quoted($subject) && + ($subject =~ /[^[:ascii:]]/)) { $subject = quote_rfc2047($subject, $auto_8bit_encoding); } diff --git a/t/t9001-send-email.sh b/t/t9001-send-email.sh index 89fcedaa3..6c6af7d13 100755 --- a/t/t9001-send-email.sh +++ b/t/t9001-send-email.sh @@ -1142,6 +1142,23 @@ Dieser deutsche Text enthält einen Umlaut! EOF ' +test_expect_success $PREREQ 'setup expect' ' +cat >expected <stdout && + grep "Subject" msgtxt1 >actual && + test_cmp expected actual +' + test_expect_success $PREREQ 'setup expect' ' cat >content-type-decl <