Re: [PATCH v9 4/5] t6006: add two more tests for the case i18n.commitEncoding is not set

2 messages, 2 authors, 2016-06-15 · open the first message on its own page

Re: [PATCH v9 4/5] t6006: add two more tests for the case i18n.commitEncoding is not set

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:58:00

Alexey Shumkin [off-list ref] writes:
+test_format complex-body %b <<EOF
+commit $head3
+This commit message is much longer than the others,
+and it will be encoded in iso8859-1. We should therefore
+include an iso8859 character: ¡bueno!
This is not such a good idea, as the resulting file will be in mixed
encoding (it already has a line with non-ascii that is in UTF-8),
and many editors would not like such a file.

Perhaps we should update test_format so that we can feed a quoted
input, e.g.

    +include an iso8859-1 character: <A1>bueno!

or something?
+commit $head2
+commit $head1
+EOF
+
+# Git uses i18n.commitEncoding if no i18n.logOutputEncoding set
+# so unset i18n.commitEncoding to test encoding conversion
+git config --unset i18n.commitEncoding
+
+test_format complex-subject-commitencoding-unset %s <<EOF
+commit $head3
+Test printing of complex bodies
+commit $head2
 $changed
 commit $head1
 $added
 EOF
 
-test_format complex-body %b <<EOF
+test_format complex-body-commitencoding-unset %b <<EOF
 commit $head3
 This commit message is much longer than the others,
 and it will be encoded in iso8859-1. We should therefore

Re: [PATCH v9 4/5] t6006: add two more tests for the case i18n.commitEncoding is not set

From: Alexey Shumkin <hidden>
Date: 2016-06-15 22:58:00

On Fri, Jul 05, 2013 at 12:04:34AM -0700, Junio C Hamano wrote:
Alexey Shumkin [off-list ref] writes:
quoted
+test_format complex-body %b <<EOF
+commit $head3
+This commit message is much longer than the others,
+and it will be encoded in iso8859-1. We should therefore
+include an iso8859 character: ¡bueno!
This is not such a good idea, as the resulting file will be in mixed
encoding (it already has a line with non-ascii that is in UTF-8),
and many editors would not like such a file.
I agree, there was issues when I edited that file
Perhaps we should update test_format so that we can feed a quoted
input, e.g.

    +include an iso8859-1 character: <A1>bueno!

or something?
We could use this file whole in UTF-8 but just make a conversion of
expected output as it's done a few lines above with a commit message
(stored to a file 'commit-msg' before the test 'setup complex body').
    +iconv -f utf-8 -t iso8859-1 > commit-msg <<EOF
    +Test printing of complex bodies
We can even use content of that file (as far as it's kept untouched
between that tests)
quoted
+commit $head2
+commit $head1
+EOF
+
+# Git uses i18n.commitEncoding if no i18n.logOutputEncoding set
+# so unset i18n.commitEncoding to test encoding conversion
+git config --unset i18n.commitEncoding
+
+test_format complex-subject-commitencoding-unset %s <<EOF
+commit $head3
+Test printing of complex bodies
+commit $head2
 $changed
 commit $head1
 $added
 EOF
 
-test_format complex-body %b <<EOF
+test_format complex-body-commitencoding-unset %b <<EOF
 commit $head3
 This commit message is much longer than the others,
 and it will be encoded in iso8859-1. We should therefore
-- 
Alexey Shumkin
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help