From: Junio C Hamano <gitster@pobox.com>
To: Patrick Steinhardt <ps@pks.im>
Cc: git@vger.kernel.org, Christian Couder <chriscool@tuxfamily.org>
Subject: Re: [PATCH v3 5/5] t6006: don't use iconv(1) without ICONV prereq
Date: Wed, 18 Feb 2026 09:46:04 -0800 [thread overview]
Message-ID: <xmqqfr6y7xnn.fsf@gitster.g> (raw)
In-Reply-To: <20260218-b4-pks-ci-msvc-iconv-fixes-v3-5-08c1ff3ffc9a@pks.im> (Patrick Steinhardt's message of "Wed, 18 Feb 2026 05:38:42 +0100")
Patrick Steinhardt <ps@pks.im> writes:
> Two tests in t6006 depend on the iconv(1) prerequisite to reencode a
> commit message. This executable may not even exist though in case the
> prereq is not set, which will cause the tests to fail.
>
> Fix this by using UTF-8 instead when the prereq is not set.
The above makes perfect sense, but would the rest of the test
involving this data need to be adjusted to expect utf-8 instead of
$test_encoding when iconv is not available?
> -iconv -f utf-8 -t $test_encoding > commit-msg <<EOF
> -Test printing of complex bodies
> +test_expect_success 'setup complex body' '
> + message=$(cat <<-EOF
> + Test printing of complex bodies
>
> -This commit message is much longer than the others,
> -and it will be encoded in $test_encoding. We should therefore
> -include an ISO8859 character: ¡bueno!
> -EOF
> + This commit message is much longer than the others,
> + and it will be encoded in $test_encoding. We should therefore
> + include an ISO8859 character: ¡bueno!
> + EOF
> + ) &&
Creative use of "cat" only to strip leading. Otherwise,
message="Test printing of ...
...
include an ISO8859 character: ¡bueno!"
would have sufficed ;-).
> + if test_have_prereq ICONV
> + then
> + echo "$message" | iconv -f utf-8 -t $test_encoding >commit-msg
> + else
> + echo "$message" >commit-msg
> + fi &&
So we have the message in the file encoded in either utf-8 or
the target encoding.
> -test_expect_success 'setup complex body' '
> git config i18n.commitencoding $test_encoding &&
But we claim unconditionally $test_encoding is used in the commit
object. This is OK because test_encoding is also set to UTF-8 in the
IONV challenged environment. Cute.
> @@ -448,7 +456,12 @@ test_expect_success 'setup expected messages (for test %b)' '
> commit $head2
> commit $head1
> EOF
> - iconv -f utf-8 -t $test_encoding expected.utf-8 >expected.ISO8859-1
> + if test_have_prereq ICONV
> + then
> + iconv -f utf-8 -t $test_encoding expected.utf-8 >expected.ISO8859-1
> + else
> + cp expected.utf-8 expected.ISO8859-1
> + fi
> '
>
> test_format complex-body %b <expected.ISO8859-1
And this is the same idea. It is confiusing that the data has
nothing to do with Latin-1 when iconv is not in use, but things will
even out. Nice.
next prev parent reply other threads:[~2026-02-18 17:46 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-09 12:42 [PATCH 0/4] Fix tests with missing iconv(1) executable Patrick Steinhardt
2026-02-09 12:42 ` [PATCH 1/4] t4xxx: don't use iconv(1) without ICONV prereq Patrick Steinhardt
2026-02-09 17:55 ` Junio C Hamano
2026-02-10 11:14 ` Torsten Bögershausen
2026-02-10 14:12 ` Patrick Steinhardt
2026-02-10 15:43 ` Junio C Hamano
2026-02-09 12:42 ` [PATCH 2/4] t4205: improve handling of ICONV prerequisite Patrick Steinhardt
2026-02-09 12:42 ` [PATCH 3/4] t5550: add ICONV prereq to tests that use "$HTTPD_URL/error" Patrick Steinhardt
2026-02-09 12:42 ` [PATCH 4/4] t6006: don't use iconv(1) without ICONV prereq Patrick Steinhardt
2026-02-16 8:57 ` [PATCH 0/4] Fix tests with missing iconv(1) executable Christian Couder
2026-02-17 11:54 ` Patrick Steinhardt
2026-02-16 9:23 ` Christian Couder
2026-02-17 11:54 ` Patrick Steinhardt
2026-02-17 13:58 ` [PATCH v2 " Patrick Steinhardt
2026-02-17 13:58 ` [PATCH v2 1/4] t4xxx: don't use iconv(1) without ICONV prereq Patrick Steinhardt
2026-02-17 14:48 ` Christian Couder
2026-02-17 15:18 ` Patrick Steinhardt
2026-02-17 13:58 ` [PATCH v2 2/4] t4205: improve handling of ICONV prerequisite Patrick Steinhardt
2026-02-17 13:58 ` [PATCH v2 3/4] t5550: add ICONV prereq to tests that use "$HTTPD_URL/error" Patrick Steinhardt
2026-02-17 13:58 ` [PATCH v2 4/4] t6006: don't use iconv(1) without ICONV prereq Patrick Steinhardt
2026-02-18 4:38 ` [PATCH v3 0/5] Fix tests with missing iconv(1) executable Patrick Steinhardt
2026-02-18 4:38 ` [PATCH v3 1/5] t: don't set ICONV prereq when iconv(1) is missing Patrick Steinhardt
2026-02-18 4:38 ` [PATCH v3 2/5] t40xx: don't use iconv(1) without ICONV prereq Patrick Steinhardt
2026-02-18 4:38 ` [PATCH v3 3/5] t4205: improve handling of ICONV prerequisite Patrick Steinhardt
2026-02-18 4:38 ` [PATCH v3 4/5] t5550: add ICONV prereq to tests that use "$HTTPD_URL/error" Patrick Steinhardt
2026-02-19 23:49 ` Eric Sunshine
2026-02-20 8:00 ` Patrick Steinhardt
2026-02-18 4:38 ` [PATCH v3 5/5] t6006: don't use iconv(1) without ICONV prereq Patrick Steinhardt
2026-02-18 17:46 ` Junio C Hamano [this message]
2026-02-18 6:46 ` [PATCH v3 0/5] Fix tests with missing iconv(1) executable Christian Couder
2026-02-18 7:09 ` Patrick Steinhardt
2026-02-20 8:25 ` [PATCH v4 " Patrick Steinhardt
2026-02-20 8:25 ` [PATCH v4 1/5] t: don't set ICONV prereq when iconv(1) is missing Patrick Steinhardt
2026-02-20 8:26 ` [PATCH v4 2/5] t40xx: don't use iconv(1) without ICONV prereq Patrick Steinhardt
2026-02-20 8:26 ` [PATCH v4 3/5] t4205: improve handling of ICONV prerequisite Patrick Steinhardt
2026-02-20 8:26 ` [PATCH v4 4/5] t5550: add ICONV prereq to tests that use "$HTTPD_URL/error" Patrick Steinhardt
2026-02-20 8:26 ` [PATCH v4 5/5] t6006: don't use iconv(1) without ICONV prereq Patrick Steinhardt
2026-02-20 15:53 ` [PATCH v4 0/5] Fix tests with missing iconv(1) executable Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqqfr6y7xnn.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=chriscool@tuxfamily.org \
--cc=git@vger.kernel.org \
--cc=ps@pks.im \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox