{"thread":{"id":"64957","subject":"[PATCH 0/4] Fix tests with missing iconv(1) executable","startedAt":"2026-02-09T12:42:36Z","lastAt":"2026-02-20T15:53:55Z","messageCount":38,"participants":["Patrick Steinhardt","Junio C Hamano","Torsten Bögershausen","Christian Couder","Eric Sunshine"],"isPatch":true,"patchVersion":1,"patchTotal":4},"messages":[{"id":"535523","messageId":"20260209-b4-pks-ci-msvc-iconv-fixes-v1-0-1e3167cd8828@pks.im","threadId":"64957","inReplyTo":null,"subject":"[PATCH 0/4] Fix tests with missing iconv(1) executable","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2026-02-09T12:42:03Z","receivedAt":"2026-02-09T12:42:36Z","isPatch":true,"sender":{"key":"ps@pks.im","avatar":"https://avatars.githubusercontent.com/u/4056630?v=4"},"body":"Hi,\n\nI recently noticed that th MSVC-based tests in GitLab CI started to\nfail. The root cause is that the iconv(1) executable cannot be found on\nthis platform anymore. This isn't entirely surprising: we depend on the\nGit for Windows environment to provide necessary shell tools, and that\nenvironment of course is not a fully fledged MSYS2 installation.\n\nIn any case, this patch series fixes those issues by building on top of\nthe ICONV prerequisite. If the prereq isn't found, then we also don't\nassume that the iconv(1) executable exists.\n\nAn alternative strategy would be to introduce a new ICONV_EXECUTABLE\nprereq. But given that Git doesn't perform any kind of reencoding itself\nin case the ICONV support isn't built into it I found it to not be worth\nthe additional hassle.\n\nIn any case, this patch series causes the MSVC jobs to pass again on\nGitLab CI.\n\nThanks!\n\nPatrick\n\n---\nPatrick Steinhardt (4):\n      t4xxx: don't use iconv(1) without ICONV prereq\n      t4205: improve handling of ICONV prerequisite\n      t5550: add ICONV prereq to tests that use \"$HTTPD_URL/error\"\n      t6006: don't use iconv(1) without ICONV prereq\n\n t/t4041-diff-submodule-option.sh             |  8 +++--\n t/t4059-diff-submodule-not-initialized.sh    |  8 +++--\n t/t4060-diff-submodule-option-diff-format.sh |  8 +++--\n t/t4205-log-pretty-formats.sh                | 50 ++++++++++++++++------------\n t/t5550-http-fetch-dumb.sh                   | 20 +++++------\n t/t6006-rev-list-format.sh                   | 29 +++++++++++-----\n 6 files changed, 77 insertions(+), 46 deletions(-)\n\n\n---\nbase-commit: 3e0db84c88c57e70ac8be8c196dfa92c5d656fbc\nchange-id: 20260209-b4-pks-ci-msvc-iconv-fixes-13de4801643f\n\n"},{"id":"535524","messageId":"20260209-b4-pks-ci-msvc-iconv-fixes-v1-1-1e3167cd8828@pks.im","threadId":"64957","inReplyTo":"20260209-b4-pks-ci-msvc-iconv-fixes-v1-0-1e3167cd8828@pks.im","subject":"[PATCH 1/4] t4xxx: don't use iconv(1) without ICONV prereq","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2026-02-09T12:42:04Z","receivedAt":"2026-02-09T12:42:37Z","isPatch":true,"sender":{"key":"ps@pks.im","avatar":"https://avatars.githubusercontent.com/u/4056630?v=4"},"body":"We've got a couple of tests that all use the iconv(1) executable to\nconvert the encoding of a commit message. All of these tests are\nprepared to handle a missing ICONV prereq, in which case they will\nsimply use UTF-8 encoding.\n\nBut even if the ICONV prerequisite has failed we try to use the iconv(1)\nexecutable. But it's not a safe to assume that the executable exists in\nthat case. And besides that, it's also unnecessary to use iconv(1) in\nthe first place, as we would only use it to convert from UTF-8 to UTF-8,\nwhich should be equivalent to a no-op.\n\nFix the issue and skip the call to iconv(1) in case the prerequisite is\nnot set. This makes tests work on systems that don't have iconv at all.\n\nNote that arguably, it's even unsafe to assume that the iconv(1)\nexecutable exists only because Git has been built with support for it.\nA more wholistic approach would thus be to split up the ICONV prereq\ninto two prereqs: one that tells us whether Git has been built with\nICONV support, and one that tells us whether the iconv(1) executable\nexists. But that would lead to a bunch of changes throughout our tests,\nand for arguably negligible benefit.\n\nSigned-off-by: Patrick Steinhardt <ps@pks.im>\n---\n t/t4041-diff-submodule-option.sh             | 8 ++++++--\n t/t4059-diff-submodule-not-initialized.sh    | 8 ++++++--\n t/t4060-diff-submodule-option-diff-format.sh | 8 ++++++--\n 3 files changed, 18 insertions(+), 6 deletions(-)\n\ndiff --git a/t/t4041-diff-submodule-option.sh b/t/t4041-diff-submodule-option.sh\nindex 4d4aa1650f..4dd4954260 100755\n--- a/t/t4041-diff-submodule-option.sh\n+++ b/t/t4041-diff-submodule-option.sh\n@@ -37,8 +37,12 @@ add_file () {\n \t\t\ttest_tick &&\n \t\t\t# \"git commit -m\" would break MinGW, as Windows refuse to pass\n \t\t\t# $test_encoding encoded parameter to git.\n-\t\t\techo \"Add $name ($added $name)\" | iconv -f utf-8 -t $test_encoding |\n-\t\t\tgit -c \"i18n.commitEncoding=$test_encoding\" commit -F -\n+\t\t\tmessage=\"Add $name ($added $name)\" &&\n+\t\t\tif test_have_prereq ICONV\n+\t\t\tthen\n+\t\t\t\tmessage=$(echo \"$message\" | iconv -f utf-8 -t $test_encoding)\n+\t\t\tfi &&\n+\t\t\techo \"$message\" | git -c \"i18n.commitEncoding=$test_encoding\" commit -F -\n \t\tdone >/dev/null &&\n \t\tgit rev-parse --short --verify HEAD\n \t)\ndiff --git a/t/t4059-diff-submodule-not-initialized.sh b/t/t4059-diff-submodule-not-initialized.sh\nindex 0fe81056d5..bb902ce94d 100755\n--- a/t/t4059-diff-submodule-not-initialized.sh\n+++ b/t/t4059-diff-submodule-not-initialized.sh\n@@ -35,8 +35,12 @@ add_file () {\n \t\t\ttest_tick &&\n \t\t\t# \"git commit -m\" would break MinGW, as Windows refuse to pass\n \t\t\t# $test_encoding encoded parameter to git.\n-\t\t\techo \"Add $name ($added $name)\" | iconv -f utf-8 -t $test_encoding |\n-\t\t\tgit -c \"i18n.commitEncoding=$test_encoding\" commit -F -\n+\t\t\tmessage=\"Add $name ($added $name)\" &&\n+\t\t\tif test_have_prereq ICONV\n+\t\t\tthen\n+\t\t\t\tmessage=$(echo \"$message\" | iconv -f utf-8 -t $test_encoding)\n+\t\t\tfi &&\n+\t\t\techo \"$message\" | git -c \"i18n.commitEncoding=$test_encoding\" commit -F -\n \t\tdone >/dev/null &&\n \t\tgit rev-parse --short --verify HEAD\n \t)\ndiff --git a/t/t4060-diff-submodule-option-diff-format.sh b/t/t4060-diff-submodule-option-diff-format.sh\nindex dbfeb7470b..d8f9213255 100755\n--- a/t/t4060-diff-submodule-option-diff-format.sh\n+++ b/t/t4060-diff-submodule-option-diff-format.sh\n@@ -35,8 +35,12 @@ add_file () {\n \t\t\ttest_tick &&\n \t\t\t# \"git commit -m\" would break MinGW, as Windows refuse to pass\n \t\t\t# $test_encoding encoded parameter to git.\n-\t\t\techo \"Add $name ($added $name)\" | iconv -f utf-8 -t $test_encoding |\n-\t\t\tgit -c \"i18n.commitEncoding=$test_encoding\" commit -F -\n+\t\t\tmessage=\"Add $name ($added $name)\" &&\n+\t\t\tif test_have_prereq ICONV\n+\t\t\tthen\n+\t\t\t\tmessage=$(echo \"$message\" | iconv -f utf-8 -t $test_encoding)\n+\t\t\tfi &&\n+\t\t\techo \"$message\" | git -c \"i18n.commitEncoding=$test_encoding\" commit -F -\n \t\tdone >/dev/null &&\n \t\tgit rev-parse --short --verify HEAD\n \t)\n\n-- \n2.53.0.295.g64333814d3.dirty\n\n"},{"id":"535525","messageId":"20260209-b4-pks-ci-msvc-iconv-fixes-v1-2-1e3167cd8828@pks.im","threadId":"64957","inReplyTo":"20260209-b4-pks-ci-msvc-iconv-fixes-v1-0-1e3167cd8828@pks.im","subject":"[PATCH 2/4] t4205: improve handling of ICONV prerequisite","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2026-02-09T12:42:05Z","receivedAt":"2026-02-09T12:42:40Z","isPatch":true,"sender":{"key":"ps@pks.im","avatar":"https://avatars.githubusercontent.com/u/4056630?v=4"},"body":"In t4205 we have a bunch of tests that depend on the iconv prereq. This\nis for most of the part because we format commit messages that have been\nencoded in an encoding different than UTF-8.\n\nThose tests fall into two classes though:\n\n  - One class of tests outputs the data as-is without reencoding.\n\n  - One class of tests outputs the data with \"i18n.logOutputEncoding\" to\n    reencode it.\n\nCuriously enough, both of these classes are marked with the ICONV\nprereq, even though one might expect that the first class wouldn't need\nthe prereq. This is because we unconditionally use ISO-8859-1 encoding\nfor the initial commit message, and thus we depend on converting to\nUTF-8 indeed.\n\nThis creates another problem though: when the iconv(1) executable does\nnot exist the test setup fails, even in the case where the ICONV prereq\nhas not been set.\n\nFix these issues by making the test encoding conditional on ICONV: if\nit's available we use ISO-8859-1, otherwise we use UTF-8. This fixes the\ntest setup on platforms without iconv(1), and it allows us to drop the\nICONV prereq from a bunch of tests.\n\nSigned-off-by: Patrick Steinhardt <ps@pks.im>\n---\n t/t4205-log-pretty-formats.sh | 50 ++++++++++++++++++++++++-------------------\n 1 file changed, 28 insertions(+), 22 deletions(-)\n\ndiff --git a/t/t4205-log-pretty-formats.sh b/t/t4205-log-pretty-formats.sh\nindex 8f2ba98963..3865f6abc7 100755\n--- a/t/t4205-log-pretty-formats.sh\n+++ b/t/t4205-log-pretty-formats.sh\n@@ -9,7 +9,12 @@ test_description='Test pretty formats'\n . ./test-lib.sh\n \n # Tested non-UTF-8 encoding\n-test_encoding=\"ISO8859-1\"\n+if test_have_prereq ICONV\n+then\n+\ttest_encoding=\"ISO8859-1\"\n+else\n+\ttest_encoding=\"UTF-8\"\n+fi\n \n sample_utf8_part=$(printf \"f\\303\\244ng\")\n \n@@ -18,7 +23,7 @@ commit_msg () {\n \t# (translated with Google Translate),\n \t# encoded in UTF-8, used as a commit log message below.\n \tmsg=\"initial. an${sample_utf8_part}lich\\n\"\n-\tif test -n \"$1\"\n+\tif test -n \"$1\" && test \"$1\" != \"UTF-8\"\n \tthen\n \t\tprintf \"$msg\" | iconv -f utf-8 -t \"$1\"\n \telse\n@@ -113,19 +118,19 @@ test_expect_success 'alias loop' '\n \ttest_must_fail git log --pretty=test-foo\n '\n \n-test_expect_success ICONV 'NUL separation' '\n+test_expect_success 'NUL separation' '\n \tprintf \"add bar\\0$(commit_msg)\" >expected &&\n \tgit log -z --pretty=\"format:%s\" >actual &&\n \ttest_cmp expected actual\n '\n \n-test_expect_success ICONV 'NUL termination' '\n+test_expect_success 'NUL termination' '\n \tprintf \"add bar\\0$(commit_msg)\\0\" >expected &&\n \tgit log -z --pretty=\"tformat:%s\" >actual &&\n \ttest_cmp expected actual\n '\n \n-test_expect_success ICONV 'NUL separation with --stat' '\n+test_expect_success 'NUL separation with --stat' '\n \tstat0_part=$(git diff --stat HEAD^ HEAD) &&\n \tstat1_part=$(git diff-tree --no-commit-id --stat --root HEAD^) &&\n \tprintf \"add bar\\n$stat0_part\\n\\0$(commit_msg)\\n$stat1_part\\n\" >expected &&\n@@ -180,7 +185,7 @@ test_expect_success 'setup more commits' '\n \thead4=$(git rev-parse --verify --short HEAD~3)\n '\n \n-test_expect_success ICONV 'left alignment formatting' '\n+test_expect_success 'left alignment formatting' '\n \tgit log --pretty=\"tformat:%<(40)%s\" >actual &&\n \tqz_to_tab_space <<-EOF >expected &&\n \tmessage two                            Z\n@@ -202,7 +207,7 @@ test_expect_success ICONV 'left alignment formatting. i18n.logOutputEncoding' '\n \ttest_cmp expected actual\n '\n \n-test_expect_success ICONV 'left alignment formatting at the nth column' '\n+test_expect_success 'left alignment formatting at the nth column' '\n \tgit log --pretty=\"tformat:%h %<|(40)%s\" >actual &&\n \tqz_to_tab_space <<-EOF >expected &&\n \t$head1 message two                    Z\n@@ -213,7 +218,7 @@ test_expect_success ICONV 'left alignment formatting at the nth column' '\n \ttest_cmp expected actual\n '\n \n-test_expect_success ICONV 'left alignment formatting at the nth column' '\n+test_expect_success 'left alignment formatting at the nth column' '\n \tCOLUMNS=50 git log --pretty=\"tformat:%h %<|(-10)%s\" >actual &&\n \tqz_to_tab_space <<-EOF >expected &&\n \t$head1 message two                    Z\n@@ -235,7 +240,7 @@ test_expect_success ICONV 'left alignment formatting at the nth column. i18n.log\n \ttest_cmp expected actual\n '\n \n-test_expect_success ICONV 'left alignment formatting with no padding' '\n+test_expect_success 'left alignment formatting with no padding' '\n \tgit log --pretty=\"tformat:%<(1)%s\" >actual &&\n \tcat <<-EOF >expected &&\n \tmessage two\n@@ -246,7 +251,7 @@ test_expect_success ICONV 'left alignment formatting with no padding' '\n \ttest_cmp expected actual\n '\n \n-test_expect_success 'left alignment formatting with no padding. i18n.logOutputEncoding' '\n+test_expect_success ICONV 'left alignment formatting with no padding. i18n.logOutputEncoding' '\n \tgit -c i18n.logOutputEncoding=$test_encoding log --pretty=\"tformat:%<(1)%s\" >actual &&\n \tcat <<-EOF | iconv -f utf-8 -t $test_encoding >expected &&\n \tmessage two\n@@ -257,7 +262,7 @@ test_expect_success 'left alignment formatting with no padding. i18n.logOutputEn\n \ttest_cmp expected actual\n '\n \n-test_expect_success ICONV 'left alignment formatting with trunc' '\n+test_expect_success 'left alignment formatting with trunc' '\n \tgit log --pretty=\"tformat:%<(10,trunc)%s\" >actual &&\n \tqz_to_tab_space <<-\\EOF >expected &&\n \tmessage ..\n@@ -279,7 +284,7 @@ test_expect_success ICONV 'left alignment formatting with trunc. i18n.logOutputE\n \ttest_cmp expected actual\n '\n \n-test_expect_success ICONV 'left alignment formatting with ltrunc' '\n+test_expect_success 'left alignment formatting with ltrunc' '\n \tgit log --pretty=\"tformat:%<(10,ltrunc)%s\" >actual &&\n \tqz_to_tab_space <<-EOF >expected &&\n \t..sage two\n@@ -301,7 +306,7 @@ test_expect_success ICONV 'left alignment formatting with ltrunc. i18n.logOutput\n \ttest_cmp expected actual\n '\n \n-test_expect_success ICONV 'left alignment formatting with mtrunc' '\n+test_expect_success 'left alignment formatting with mtrunc' '\n \tgit log --pretty=\"tformat:%<(10,mtrunc)%s\" >actual &&\n \tqz_to_tab_space <<-\\EOF >expected &&\n \tmess.. two\n@@ -323,7 +328,7 @@ test_expect_success ICONV 'left alignment formatting with mtrunc. i18n.logOutput\n \ttest_cmp expected actual\n '\n \n-test_expect_success ICONV 'right alignment formatting' '\n+test_expect_success 'right alignment formatting' '\n \tgit log --pretty=\"tformat:%>(40)%s\" >actual &&\n \tqz_to_tab_space <<-EOF >expected &&\n \tZ                            message two\n@@ -345,7 +350,7 @@ test_expect_success ICONV 'right alignment formatting. i18n.logOutputEncoding' '\n \ttest_cmp expected actual\n '\n \n-test_expect_success ICONV 'right alignment formatting at the nth column' '\n+test_expect_success 'right alignment formatting at the nth column' '\n \tgit log --pretty=\"tformat:%h %>|(40)%s\" >actual &&\n \tqz_to_tab_space <<-EOF >expected &&\n \t$head1                      message two\n@@ -356,7 +361,7 @@ test_expect_success ICONV 'right alignment formatting at the nth column' '\n \ttest_cmp expected actual\n '\n \n-test_expect_success ICONV 'right alignment formatting at the nth column' '\n+test_expect_success 'right alignment formatting at the nth column' '\n \tCOLUMNS=50 git log --pretty=\"tformat:%h %>|(-10)%s\" >actual &&\n \tqz_to_tab_space <<-EOF >expected &&\n \t$head1                      message two\n@@ -391,7 +396,7 @@ test_expect_success ICONV 'right alignment formatting at the nth column with --g\n \ttest_cmp expected actual\n '\n \n-test_expect_success ICONV 'right alignment formatting with no padding' '\n+test_expect_success 'right alignment formatting with no padding' '\n \tgit log --pretty=\"tformat:%>(1)%s\" >actual &&\n \tcat <<-EOF >expected &&\n \tmessage two\n@@ -402,7 +407,7 @@ test_expect_success ICONV 'right alignment formatting with no padding' '\n \ttest_cmp expected actual\n '\n \n-test_expect_success ICONV 'right alignment formatting with no padding and with --graph' '\n+test_expect_success 'right alignment formatting with no padding and with --graph' '\n \tgit log --graph --pretty=\"tformat:%>(1)%s\" >actual &&\n \tcat <<-EOF >expected &&\n \t* message two\n@@ -424,7 +429,7 @@ test_expect_success ICONV 'right alignment formatting with no padding. i18n.logO\n \ttest_cmp expected actual\n '\n \n-test_expect_success ICONV 'center alignment formatting' '\n+test_expect_success 'center alignment formatting' '\n \tgit log --pretty=\"tformat:%><(40)%s\" >actual &&\n \tqz_to_tab_space <<-EOF >expected &&\n \tZ             message two              Z\n@@ -445,7 +450,8 @@ test_expect_success ICONV 'center alignment formatting. i18n.logOutputEncoding'\n \tEOF\n \ttest_cmp expected actual\n '\n-test_expect_success ICONV 'center alignment formatting at the nth column' '\n+\n+test_expect_success 'center alignment formatting at the nth column' '\n \tgit log --pretty=\"tformat:%h %><|(40)%s\" >actual &&\n \tqz_to_tab_space <<-EOF >expected &&\n \t$head1           message two          Z\n@@ -456,7 +462,7 @@ test_expect_success ICONV 'center alignment formatting at the nth column' '\n \ttest_cmp expected actual\n '\n \n-test_expect_success ICONV 'center alignment formatting at the nth column' '\n+test_expect_success 'center alignment formatting at the nth column' '\n \tCOLUMNS=70 git log --pretty=\"tformat:%h %><|(-30)%s\" >actual &&\n \tqz_to_tab_space <<-EOF >expected &&\n \t$head1           message two          Z\n@@ -478,7 +484,7 @@ test_expect_success ICONV 'center alignment formatting at the nth column. i18n.l\n \ttest_cmp expected actual\n '\n \n-test_expect_success ICONV 'center alignment formatting with no padding' '\n+test_expect_success 'center alignment formatting with no padding' '\n \tgit log --pretty=\"tformat:%><(1)%s\" >actual &&\n \tcat <<-EOF >expected &&\n \tmessage two\n\n-- \n2.53.0.295.g64333814d3.dirty\n\n"},{"id":"535526","messageId":"20260209-b4-pks-ci-msvc-iconv-fixes-v1-3-1e3167cd8828@pks.im","threadId":"64957","inReplyTo":"20260209-b4-pks-ci-msvc-iconv-fixes-v1-0-1e3167cd8828@pks.im","subject":"[PATCH 3/4] t5550: add ICONV prereq to tests that use \"$HTTPD_URL/error\"","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2026-02-09T12:42:06Z","receivedAt":"2026-02-09T12:42:43Z","isPatch":true,"sender":{"key":"ps@pks.im","avatar":"https://avatars.githubusercontent.com/u/4056630?v=4"},"body":"We've got a bunch of tests in t5550 that connect to \"$HTTPD_URL/error\"\nto ensure that error messages are proprely forwarded. This URL executes\nthe \"t/lib-httpd/error.sh\" script, which in turn depends on the iconv(1)\nexecutable to reencode the message.\n\nThis executable may not exist on platforms, which will make the tests\nfail. Guard them with the ICONV prereq to fix such failures.\n\nSigned-off-by: Patrick Steinhardt <ps@pks.im>\n---\n t/t5550-http-fetch-dumb.sh | 20 ++++++++++----------\n 1 file changed, 10 insertions(+), 10 deletions(-)\n\ndiff --git a/t/t5550-http-fetch-dumb.sh b/t/t5550-http-fetch-dumb.sh\nindex ed0ad66fad..55102e702c 100755\n--- a/t/t5550-http-fetch-dumb.sh\n+++ b/t/t5550-http-fetch-dumb.sh\n@@ -339,32 +339,32 @@ test_expect_success 'fetch can handle previously-fetched .idx files' '\n '\n \n test_expect_success 'did not use upload-pack service' '\n-\t! grep \"/git-upload-pack\" \"$HTTPD_ROOT_PATH/access.log\"\n+\t! test_grep \"/git-upload-pack\" \"$HTTPD_ROOT_PATH/access.log\"\n '\n \n-test_expect_success 'git client shows text/plain errors' '\n+test_expect_success ICONV 'git client shows text/plain errors' '\n \ttest_must_fail git clone \"$HTTPD_URL/error/text\" 2>stderr &&\n-\tgrep \"this is the error message\" stderr\n+\ttest_grep \"this is the error message\" stderr\n '\n \n-test_expect_success 'git client does not show html errors' '\n+test_expect_success ICONV 'git client does not show html errors' '\n \ttest_must_fail git clone \"$HTTPD_URL/error/html\" 2>stderr &&\n-\t! grep \"this is the error message\" stderr\n+\t! test_grep \"this is the error message\" stderr\n '\n \n-test_expect_success 'git client shows text/plain with a charset' '\n+test_expect_success ICONV 'git client shows text/plain with a charset' '\n \ttest_must_fail git clone \"$HTTPD_URL/error/charset\" 2>stderr &&\n-\tgrep \"this is the error message\" stderr\n+\ttest_grep \"this is the error message\" stderr\n '\n \n test_expect_success ICONV 'http error messages are reencoded' '\n \ttest_must_fail git clone \"$HTTPD_URL/error/utf16\" 2>stderr &&\n-\tgrep \"this is the error message\" stderr\n+\ttest_grep \"this is the error message\" stderr\n '\n \n test_expect_success ICONV 'reencoding is robust to whitespace oddities' '\n \ttest_must_fail git clone \"$HTTPD_URL/error/odd-spacing\" 2>stderr &&\n-\tgrep \"this is the error message\" stderr\n+\ttest_grep \"this is the error message\" stderr\n '\n \n check_language () {\n@@ -406,7 +406,7 @@ ja;q=0.95, zh;q=0.94, sv;q=0.93, pt;q=0.92, nb;q=0.91, *;q=0.90\" \\\n \n test_expect_success 'git client send an empty Accept-Language' '\n \tGIT_TRACE_CURL=true LANGUAGE= git ls-remote \"$HTTPD_URL/dumb/repo.git\" 2>stderr &&\n-\t! grep \"^=> Send header: Accept-Language:\" stderr\n+\t! test_grep \"^=> Send header: Accept-Language:\" stderr\n '\n \n test_expect_success 'remote-http complains cleanly about malformed urls' '\n\n-- \n2.53.0.295.g64333814d3.dirty\n\n"},{"id":"535527","messageId":"20260209-b4-pks-ci-msvc-iconv-fixes-v1-4-1e3167cd8828@pks.im","threadId":"64957","inReplyTo":"20260209-b4-pks-ci-msvc-iconv-fixes-v1-0-1e3167cd8828@pks.im","subject":"[PATCH 4/4] t6006: don't use iconv(1) without ICONV prereq","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2026-02-09T12:42:07Z","receivedAt":"2026-02-09T12:42:46Z","isPatch":true,"sender":{"key":"ps@pks.im","avatar":"https://avatars.githubusercontent.com/u/4056630?v=4"},"body":"Two tests in t6006 depend on the iconv(1) prerequisite to reencode a\ncommit message. This executable may not even exist though in case the\nprereq is not set, which will cause the tests to fail.\n\nFix this by using UTF-8 instead when the prereq is not set.\n\nSigned-off-by: Patrick Steinhardt <ps@pks.im>\n---\n t/t6006-rev-list-format.sh | 29 +++++++++++++++++++++--------\n 1 file changed, 21 insertions(+), 8 deletions(-)\n\ndiff --git a/t/t6006-rev-list-format.sh b/t/t6006-rev-list-format.sh\nindex eb93d68d7d..581984467d 100755\n--- a/t/t6006-rev-list-format.sh\n+++ b/t/t6006-rev-list-format.sh\n@@ -378,15 +378,23 @@ test_expect_success 'rev-list %C(auto,...) respects --color' '\n \ttest_cmp expect actual\n '\n \n-iconv -f utf-8 -t $test_encoding > commit-msg <<EOF\n-Test printing of complex bodies\n+test_expect_success 'setup complex body' '\n+\tmessage=$(cat <<-EOF\n+\tTest printing of complex bodies\n \n-This commit message is much longer than the others,\n-and it will be encoded in $test_encoding. We should therefore\n-include an ISO8859 character: ¡bueno!\n-EOF\n+\tThis commit message is much longer than the others,\n+\tand it will be encoded in $test_encoding. We should therefore\n+\tinclude an ISO8859 character: ¡bueno!\n+\tEOF\n+\t) &&\n+\n+\tif test_have_prereq ICONV\n+\tthen\n+\t\techo \"$message\" | iconv -f utf-8 -t $test_encoding >commit-msg\n+\telse\n+\t\techo \"$message\" >commit-msg\n+\tfi &&\n \n-test_expect_success 'setup complex body' '\n \tgit config i18n.commitencoding $test_encoding &&\n \techo change2 >foo && git commit -a -F commit-msg &&\n \thead3=$(git rev-parse --verify HEAD) &&\n@@ -448,7 +456,12 @@ test_expect_success 'setup expected messages (for test %b)' '\n \tcommit $head2\n \tcommit $head1\n \tEOF\n-\ticonv -f utf-8 -t $test_encoding expected.utf-8 >expected.ISO8859-1\n+\tif test_have_prereq ICONV\n+\tthen\n+\t\ticonv -f utf-8 -t $test_encoding expected.utf-8 >expected.ISO8859-1\n+\telse\n+\t\tcp expected.utf-8 expected.ISO8859-1\n+\tfi\n '\n \n test_format complex-body %b <expected.ISO8859-1\n\n-- \n2.53.0.295.g64333814d3.dirty\n\n"},{"id":"535580","messageId":"xmqq4inp6bup.fsf@gitster.g","threadId":"64957","inReplyTo":"20260209-b4-pks-ci-msvc-iconv-fixes-v1-1-1e3167cd8828@pks.im","subject":"Re: [PATCH 1/4] t4xxx: don't use iconv(1) without ICONV prereq","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2026-02-09T17:55:10Z","receivedAt":"2026-02-09T17:55:13Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Patrick Steinhardt <ps@pks.im> writes:\n\n> We've got a couple of tests that all use the iconv(1) executable to\n> convert the encoding of a commit message. All of these tests are\n> prepared to handle a missing ICONV prereq, in which case they will\n> simply use UTF-8 encoding.\n>\n> But even if the ICONV prerequisite has failed we try to use the iconv(1)\n> executable. But it's not a safe to assume that the executable exists in\n> that case. And besides that, it's also unnecessary to use iconv(1) in\n> the first place, as we would only use it to convert from UTF-8 to UTF-8,\n> which should be equivalent to a no-op.\n>\n> Fix the issue and skip the call to iconv(1) in case the prerequisite is\n> not set. This makes tests work on systems that don't have iconv at all.\n>\n> Note that arguably, it's even unsafe to assume that the iconv(1)\n> executable exists only because Git has been built with support for it.\n> A more wholistic approach would thus be to split up the ICONV prereq\n> into two prereqs: one that tells us whether Git has been built with\n> ICONV support, and one that tells us whether the iconv(1) executable\n> exists. But that would lead to a bunch of changes throughout our tests,\n> and for arguably negligible benefit.\n>\n> Signed-off-by: Patrick Steinhardt <ps@pks.im>\n> ---\n>  t/t4041-diff-submodule-option.sh             | 8 ++++++--\n>  t/t4059-diff-submodule-not-initialized.sh    | 8 ++++++--\n>  t/t4060-diff-submodule-option-diff-format.sh | 8 ++++++--\n>  3 files changed, 18 insertions(+), 6 deletions(-)\n\nThe repetition across three files look a bit disturbing X-<.\n\n> diff --git a/t/t4041-diff-submodule-option.sh b/t/t4041-diff-submodule-option.sh\n> index 4d4aa1650f..4dd4954260 100755\n> --- a/t/t4041-diff-submodule-option.sh\n> +++ b/t/t4041-diff-submodule-option.sh\n> @@ -37,8 +37,12 @@ add_file () {\n>  \t\t\ttest_tick &&\n>  \t\t\t# \"git commit -m\" would break MinGW, as Windows refuse to pass\n>  \t\t\t# $test_encoding encoded parameter to git.\n> -\t\t\techo \"Add $name ($added $name)\" | iconv -f utf-8 -t $test_encoding |\n> -\t\t\tgit -c \"i18n.commitEncoding=$test_encoding\" commit -F -\n> +\t\t\tmessage=\"Add $name ($added $name)\" &&\n> +\t\t\tif test_have_prereq ICONV\n> +\t\t\tthen\n> +\t\t\t\tmessage=$(echo \"$message\" | iconv -f utf-8 -t $test_encoding)\n> +\t\t\tfi &&\n> +\t\t\techo \"$message\" | git -c \"i18n.commitEncoding=$test_encoding\" commit -F -\n\nThis was a bit unexpected.  Do we give any guarantee to builds that\nlack iconv support that \"git -c i18n.commitEncoding=... commit\" will\npass the payload verbatim?  I would have expected ICONV prerequisite\nis used on the whole test_expect_success to exclude the tests that\nare affected, not at such a low level.\n"},{"id":"535668","messageId":"20260210111401.GA27953@tb-raspi4","threadId":"64957","inReplyTo":"xmqq4inp6bup.fsf@gitster.g","subject":"Re: [PATCH 1/4] t4xxx: don't use iconv(1) without ICONV prereq","fromName":"Torsten Bögershausen","fromEmail":"tboegi@web.de","sentAt":"2026-02-10T11:14:01Z","receivedAt":"2026-02-10T11:14:15Z","isPatch":true,"sender":{"key":"tboegi@web.de","avatar":"https://avatars.githubusercontent.com/u/7138363?v=4"},"body":"On Mon, Feb 09, 2026 at 09:55:10AM -0800, Junio C Hamano wrote:\n> Patrick Steinhardt <ps@pks.im> writes:\n> \n> > We've got a couple of tests that all use the iconv(1) executable to\n> > convert the encoding of a commit message. All of these tests are\n> > prepared to handle a missing ICONV prereq, in which case they will\n> > simply use UTF-8 encoding.\n> >\n> > But even if the ICONV prerequisite has failed we try to use the iconv(1)\n> > executable. But it's not a safe to assume that the executable exists in\n> > that case. And besides that, it's also unnecessary to use iconv(1) in\n> > the first place, as we would only use it to convert from UTF-8 to UTF-8,\n> > which should be equivalent to a no-op.\n> >\n> > Fix the issue and skip the call to iconv(1) in case the prerequisite is\n> > not set. This makes tests work on systems that don't have iconv at all.\n> >\n> > Note that arguably, it's even unsafe to assume that the iconv(1)\n> > executable exists only because Git has been built with support for it.\n> > A more wholistic approach would thus be to split up the ICONV prereq\n> > into two prereqs: one that tells us whether Git has been built with\n> > ICONV support, and one that tells us whether the iconv(1) executable\n> > exists. But that would lead to a bunch of changes throughout our tests,\n> > and for arguably negligible benefit.\n> >\n> > Signed-off-by: Patrick Steinhardt <ps@pks.im>\n> > ---\n> >  t/t4041-diff-submodule-option.sh             | 8 ++++++--\n> >  t/t4059-diff-submodule-not-initialized.sh    | 8 ++++++--\n> >  t/t4060-diff-submodule-option-diff-format.sh | 8 ++++++--\n> >  3 files changed, 18 insertions(+), 6 deletions(-)\n> \n> The repetition across three files look a bit disturbing X-<.\n> \n> > diff --git a/t/t4041-diff-submodule-option.sh b/t/t4041-diff-submodule-option.sh\n> > index 4d4aa1650f..4dd4954260 100755\n> > --- a/t/t4041-diff-submodule-option.sh\n> > +++ b/t/t4041-diff-submodule-option.sh\n> > @@ -37,8 +37,12 @@ add_file () {\n> >  \t\t\ttest_tick &&\n> >  \t\t\t# \"git commit -m\" would break MinGW, as Windows refuse to pass\n> >  \t\t\t# $test_encoding encoded parameter to git.\n> > -\t\t\techo \"Add $name ($added $name)\" | iconv -f utf-8 -t $test_encoding |\n> > -\t\t\tgit -c \"i18n.commitEncoding=$test_encoding\" commit -F -\n> > +\t\t\tmessage=\"Add $name ($added $name)\" &&\n> > +\t\t\tif test_have_prereq ICONV\n> > +\t\t\tthen\n> > +\t\t\t\tmessage=$(echo \"$message\" | iconv -f utf-8 -t $test_encoding)\n> > +\t\t\tfi &&\n> > +\t\t\techo \"$message\" | git -c \"i18n.commitEncoding=$test_encoding\" commit -F -\n> \n> This was a bit unexpected.  Do we give any guarantee to builds that\n> lack iconv support that \"git -c i18n.commitEncoding=... commit\" will\n> pass the payload verbatim?  I would have expected ICONV prerequisite\n> is used on the whole test_expect_success to exclude the tests that\n> are affected, not at such a low level.\n> \n\nTo my understanding there are 2 different things:\n- Does the platform have libiconv (which is linked into Git,\n   and handles the commit encoding)\n- Does the platform ship the iconv binary ?\n  It seems as if mingw has stopped to ship the iconv binary.\n  And as a result, Git for Windows is missing it, too.\n\n(And if someone asks me: it probably makes sense to bring it back)\n\nhttps://github.com/git-for-windows/git/issues/6083\n\n"},{"id":"535678","messageId":"aYs8zajWSixG8i3c@pks.im","threadId":"64957","inReplyTo":"20260210111401.GA27953@tb-raspi4","subject":"Re: [PATCH 1/4] t4xxx: don't use iconv(1) without ICONV prereq","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2026-02-10T14:12:29Z","receivedAt":"2026-02-10T14:12:36Z","isPatch":true,"sender":{"key":"ps@pks.im","avatar":"https://avatars.githubusercontent.com/u/4056630?v=4"},"body":"On Tue, Feb 10, 2026 at 12:14:01PM +0100, Torsten Bögershausen wrote:\n> On Mon, Feb 09, 2026 at 09:55:10AM -0800, Junio C Hamano wrote:\n> > Patrick Steinhardt <ps@pks.im> writes:\n> > \n> > > We've got a couple of tests that all use the iconv(1) executable to\n> > > convert the encoding of a commit message. All of these tests are\n> > > prepared to handle a missing ICONV prereq, in which case they will\n> > > simply use UTF-8 encoding.\n> > >\n> > > But even if the ICONV prerequisite has failed we try to use the iconv(1)\n> > > executable. But it's not a safe to assume that the executable exists in\n> > > that case. And besides that, it's also unnecessary to use iconv(1) in\n> > > the first place, as we would only use it to convert from UTF-8 to UTF-8,\n> > > which should be equivalent to a no-op.\n> > >\n> > > Fix the issue and skip the call to iconv(1) in case the prerequisite is\n> > > not set. This makes tests work on systems that don't have iconv at all.\n> > >\n> > > Note that arguably, it's even unsafe to assume that the iconv(1)\n> > > executable exists only because Git has been built with support for it.\n> > > A more wholistic approach would thus be to split up the ICONV prereq\n> > > into two prereqs: one that tells us whether Git has been built with\n> > > ICONV support, and one that tells us whether the iconv(1) executable\n> > > exists. But that would lead to a bunch of changes throughout our tests,\n> > > and for arguably negligible benefit.\n> > >\n> > > Signed-off-by: Patrick Steinhardt <ps@pks.im>\n> > > ---\n> > >  t/t4041-diff-submodule-option.sh             | 8 ++++++--\n> > >  t/t4059-diff-submodule-not-initialized.sh    | 8 ++++++--\n> > >  t/t4060-diff-submodule-option-diff-format.sh | 8 ++++++--\n> > >  3 files changed, 18 insertions(+), 6 deletions(-)\n> > \n> > The repetition across three files look a bit disturbing X-<.\n\nYeah, agreed. I was wondering whether I should have another preparatory\ncommit that deduplicates the logic, but ultimately I cared more about\nfixing the CI failures that we currrently face.\n\n> > > diff --git a/t/t4041-diff-submodule-option.sh b/t/t4041-diff-submodule-option.sh\n> > > index 4d4aa1650f..4dd4954260 100755\n> > > --- a/t/t4041-diff-submodule-option.sh\n> > > +++ b/t/t4041-diff-submodule-option.sh\n> > > @@ -37,8 +37,12 @@ add_file () {\n> > >  \t\t\ttest_tick &&\n> > >  \t\t\t# \"git commit -m\" would break MinGW, as Windows refuse to pass\n> > >  \t\t\t# $test_encoding encoded parameter to git.\n> > > -\t\t\techo \"Add $name ($added $name)\" | iconv -f utf-8 -t $test_encoding |\n> > > -\t\t\tgit -c \"i18n.commitEncoding=$test_encoding\" commit -F -\n> > > +\t\t\tmessage=\"Add $name ($added $name)\" &&\n> > > +\t\t\tif test_have_prereq ICONV\n> > > +\t\t\tthen\n> > > +\t\t\t\tmessage=$(echo \"$message\" | iconv -f utf-8 -t $test_encoding)\n> > > +\t\t\tfi &&\n> > > +\t\t\techo \"$message\" | git -c \"i18n.commitEncoding=$test_encoding\" commit -F -\n> > \n> > This was a bit unexpected.  Do we give any guarantee to builds that\n> > lack iconv support that \"git -c i18n.commitEncoding=... commit\" will\n> > pass the payload verbatim?  \n\nIn case the ICONV prereq is false we set up \"UTF-8\" as test encoding.\nAnd UTF-8 is also the default encoding that we also specify in case the\nabove configuration hasn't been set, see `get_commit_output_encoding()`.\nSo this would essentially be a no-op and is expected to behave the exact\nsame as if the configuration wasn't set.\n\n> > I would have expected ICONV prerequisite is used on the whole\n> > test_expect_success to exclude the tests that are affected, not at\n> > such a low level.\n\nThe thing is that many of the tests are actually things that we really\nwant to test regardless of whether or not we have the ICONV prereq. They\naren't inherently specific to any specific encoding, even though we\n_also_ verify that the encoding works as expected.\n\nI didn't want to decrease test coverage, so I tried to only add ICONV\nprerequisites where tests couldn't be trivially made to pass without the\nbinary.\n\n> To my understanding there are 2 different things:\n> - Does the platform have libiconv (which is linked into Git,\n>    and handles the commit encoding)\n> - Does the platform ship the iconv binary ?\n>   It seems as if mingw has stopped to ship the iconv binary.\n>   And as a result, Git for Windows is missing it, too.\n> \n> (And if someone asks me: it probably makes sense to bring it back)\n> \n> https://github.com/git-for-windows/git/issues/6083\n\nYeah, this change in GfW is indeed the root cause of the CI failures.\nBut even if the iconv binary were to come back I think it's somewhat\nsensible to assume that the iconv(1) binary may not exist when built\nwith NO_ICONV. There might for example be platforms out there that have\nno iconv support at all, and the patches in this series would help\nthose.\n\nThanks!\n\nPatrick\n"},{"id":"535684","messageId":"xmqq7bsk1u5f.fsf@gitster.g","threadId":"64957","inReplyTo":"aYs8zajWSixG8i3c@pks.im","subject":"Re: [PATCH 1/4] t4xxx: don't use iconv(1) without ICONV prereq","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2026-02-10T15:43:24Z","receivedAt":"2026-02-10T15:43:26Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Patrick Steinhardt <ps@pks.im> writes:\n\n> But even if the iconv binary were to come back I think it's somewhat\n> sensible to assume that the iconv(1) binary may not exist when built\n> with NO_ICONV. There might for example be platforms out there that have\n> no iconv support at all, and the patches in this series would help\n> those.\n\nMakes sense.  Thanks.\n"},{"id":"536093","messageId":"CAP8UFD0zja_P7fOuCtLt46ubit+QTOME2K4+M9N=CQNceevMBQ@mail.gmail.com","threadId":"64957","inReplyTo":"20260209-b4-pks-ci-msvc-iconv-fixes-v1-0-1e3167cd8828@pks.im","subject":"Re: [PATCH 0/4] Fix tests with missing iconv(1) executable","fromName":"Christian Couder","fromEmail":"christian.couder@gmail.com","sentAt":"2026-02-16T08:57:33Z","receivedAt":"2026-02-16T08:57:46Z","isPatch":true,"sender":{"key":"christian.couder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/208954?v=4"},"body":"Hi,\n\nOn Mon, Feb 9, 2026 at 1:42 PM Patrick Steinhardt <ps@pks.im> wrote:\n>\n> Hi,\n>\n> I recently noticed that th MSVC-based tests in GitLab CI started to\n> fail. The root cause is that the iconv(1) executable cannot be found on\n> this platform anymore. This isn't entirely surprising: we depend on the\n> Git for Windows environment to provide necessary shell tools, and that\n> environment of course is not a fully fledged MSYS2 installation.\n>\n> In any case, this patch series fixes those issues by building on top of\n> the ICONV prerequisite. If the prereq isn't found, then we also don't\n> assume that the iconv(1) executable exists.\n\nI think it's reasonable to assume that iconv isn't available if the\nICONV prereq isn't satisfied.\n\n> An alternative strategy would be to introduce a new ICONV_EXECUTABLE\n> prereq. But given that Git doesn't perform any kind of reencoding itself\n> in case the ICONV support isn't built into it I found it to not be worth\n> the additional hassle.\n\nI agree that it's better to not add a new ICONV_EXECUTABLE prereq if\npossible, as it keeps things simple.\n\n> In any case, this patch series causes the MSVC jobs to pass again on\n> GitLab CI.\n\nI think it would be nice if this could talk a bit about the NO_ICONV\nbuild knob and how it still relates to the ICONV prereq though.\n\nBefore this series, for example, the Makefile says:\n\n  # Define NO_ICONV if your libc does not properly support iconv.\n\nwhile t/test-lib.sh has:\n\n  test -z \"$NO_ICONV\" && test_set_prereq ICONV\n\nUnfortunately the diffstat below:\n\n>  t/t4041-diff-submodule-option.sh             |  8 +++--\n>  t/t4059-diff-submodule-not-initialized.sh    |  8 +++--\n>  t/t4060-diff-submodule-option-diff-format.sh |  8 +++--\n>  t/t4205-log-pretty-formats.sh                | 50 ++++++++++++++++------------\n>  t/t5550-http-fetch-dumb.sh                   | 20 +++++------\n>  t/t6006-rev-list-format.sh                   | 29 +++++++++++-----\n>  6 files changed, 77 insertions(+), 46 deletions(-)\n\nshows no change in the Makefile, or any build infrastructure file,\ndespite the fact that the series changes the one-to-one relationship\nbetween the NO_ICONV build knob and the ICONV prereq.\n\nIn the Makefile, for example, I think something like the following\nwould be nice:\n\ndiff --git a/Makefile b/Makefile\nindex 47ed9fa7fd..ed54071fd7 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -182,7 +182,9 @@ include shared.mak\n# Define NO_SOCKADDR_STORAGE if your platform does not have struct\n# sockaddr_storage.\n#\n-# Define NO_ICONV if your libc does not properly support iconv.\n+# Define NO_ICONV if your libc does not properly support iconv. Note that for\n+# simplicity the test suite assumes that iconv(1) is available if and only if\n+# NO_ICONV is not defined.\n#\n# Define OLD_ICONV if your library has an old iconv(), where the second\n# (input buffer pointer) parameter is declared with type (const char **).\n\nNot sure how a similar update should be done in configure.ac or\nmeson.build but maybe it might be worth clarifying things there too.\n\nOn the other hand maybe we can say that the situation regarding the\ndocumentation of iconv(1) and the build knobs was quite bad before\nthis series already and that a full separate patch series would be\nrequired to improve on that. But I think at least this cover letter\nshould say that.\n"},{"id":"536094","messageId":"CAP8UFD0=7sCe6oEG33gb8Gzug_ig4m-breNJeUbBk1AUvuaR4w@mail.gmail.com","threadId":"64957","inReplyTo":"20260209-b4-pks-ci-msvc-iconv-fixes-v1-0-1e3167cd8828@pks.im","subject":"Re: [PATCH 0/4] Fix tests with missing iconv(1) executable","fromName":"Christian Couder","fromEmail":"christian.couder@gmail.com","sentAt":"2026-02-16T09:23:16Z","receivedAt":"2026-02-16T09:23:29Z","isPatch":true,"sender":{"key":"christian.couder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/208954?v=4"},"body":"On Mon, Feb 9, 2026 at 1:42 PM Patrick Steinhardt <ps@pks.im> wrote:\n>\n> Hi,\n>\n> I recently noticed that th MSVC-based tests in GitLab CI started to\n\ns/that th/that the/\n\n> fail. The root cause is that the iconv(1) executable cannot be found on\n> this platform anymore. This isn't entirely surprising: we depend on the\n> Git for Windows environment to provide necessary shell tools, and that\n> environment of course is not a fully fledged MSYS2 installation.\n\nMaybe this and perhaps some commit messages of the patches in the\nseries could also talk about\nhttps://github.com/git-for-windows/git/issues/6083 a bit now that we\nknow it's related.\n\nExcept for this and the documentation issue in the build system I\nmentioned in my previous email, the patches in the series look good to\nme.\n\nThanks.\n"},{"id":"536174","messageId":"aZRXBFIMEAUQCJAu@pks.im","threadId":"64957","inReplyTo":"CAP8UFD0=7sCe6oEG33gb8Gzug_ig4m-breNJeUbBk1AUvuaR4w@mail.gmail.com","subject":"Re: [PATCH 0/4] Fix tests with missing iconv(1) executable","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2026-02-17T11:54:44Z","receivedAt":"2026-02-17T11:54:52Z","isPatch":true,"sender":{"key":"ps@pks.im","avatar":"https://avatars.githubusercontent.com/u/4056630?v=4"},"body":"On Mon, Feb 16, 2026 at 10:23:16AM +0100, Christian Couder wrote:\n> On Mon, Feb 9, 2026 at 1:42 PM Patrick Steinhardt <ps@pks.im> wrote:\n> >\n> > Hi,\n> >\n> > I recently noticed that th MSVC-based tests in GitLab CI started to\n> \n> s/that th/that the/\n\nWill fix, but given that this is the cover letter anyway I don't think\nit matters much.\n\n> > fail. The root cause is that the iconv(1) executable cannot be found on\n> > this platform anymore. This isn't entirely surprising: we depend on the\n> > Git for Windows environment to provide necessary shell tools, and that\n> > environment of course is not a fully fledged MSYS2 installation.\n> \n> Maybe this and perhaps some commit messages of the patches in the\n> series could also talk about\n> https://github.com/git-for-windows/git/issues/6083 a bit now that we\n> know it's related.\n\nYup, makes sense.\n\nPatrick\n"},{"id":"536175","messageId":"aZRXCvP17Ple4qBB@pks.im","threadId":"64957","inReplyTo":"CAP8UFD0zja_P7fOuCtLt46ubit+QTOME2K4+M9N=CQNceevMBQ@mail.gmail.com","subject":"Re: [PATCH 0/4] Fix tests with missing iconv(1) executable","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2026-02-17T11:54:50Z","receivedAt":"2026-02-17T11:54:56Z","isPatch":true,"sender":{"key":"ps@pks.im","avatar":"https://avatars.githubusercontent.com/u/4056630?v=4"},"body":"On Mon, Feb 16, 2026 at 09:57:33AM +0100, Christian Couder wrote:\n> On Mon, Feb 9, 2026 at 1:42 PM Patrick Steinhardt <ps@pks.im> wrote:\n> > In any case, this patch series causes the MSVC jobs to pass again on\n> > GitLab CI.\n> \n> I think it would be nice if this could talk a bit about the NO_ICONV\n> build knob and how it still relates to the ICONV prereq though.\n> \n> Before this series, for example, the Makefile says:\n> \n>   # Define NO_ICONV if your libc does not properly support iconv.\n> \n> while t/test-lib.sh has:\n> \n>   test -z \"$NO_ICONV\" && test_set_prereq ICONV\n> \n> Unfortunately the diffstat below:\n> \n> >  t/t4041-diff-submodule-option.sh             |  8 +++--\n> >  t/t4059-diff-submodule-not-initialized.sh    |  8 +++--\n> >  t/t4060-diff-submodule-option-diff-format.sh |  8 +++--\n> >  t/t4205-log-pretty-formats.sh                | 50 ++++++++++++++++------------\n> >  t/t5550-http-fetch-dumb.sh                   | 20 +++++------\n> >  t/t6006-rev-list-format.sh                   | 29 +++++++++++-----\n> >  6 files changed, 77 insertions(+), 46 deletions(-)\n> \n> shows no change in the Makefile, or any build infrastructure file,\n> despite the fact that the series changes the one-to-one relationship\n> between the NO_ICONV build knob and the ICONV prereq.\n> \n> In the Makefile, for example, I think something like the following\n> would be nice:\n\nAgreed, it makes sense to document this. I'll do so in the test lib\nthough, and also expand how we define the ICONV prerequisite to cover\nthe new semantics.\n\nPatrick\n"},{"id":"536184","messageId":"20260217-b4-pks-ci-msvc-iconv-fixes-v2-0-25491bc8dbf8@pks.im","threadId":"64957","inReplyTo":"20260209-b4-pks-ci-msvc-iconv-fixes-v1-0-1e3167cd8828@pks.im","subject":"[PATCH v2 0/4] Fix tests with missing iconv(1) executable","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2026-02-17T13:58:26Z","receivedAt":"2026-02-17T13:58:34Z","isPatch":true,"sender":{"key":"ps@pks.im","avatar":"https://avatars.githubusercontent.com/u/4056630?v=4"},"body":"Hi,\n\nI recently noticed that the MSVC-based tests in GitLab CI started to\nfail. The root cause is that the iconv(1) executable cannot be found on\nthis platform anymore. This isn't entirely surprising: we depend on the\nGit for Windows environment to provide necessary shell tools, and that\nenvironment of course is not a fully fledged MSYS2 installation.\n\nIn any case, this patch series fixes those issues by building on top of\nthe ICONV prerequisite. If the prereq isn't found, then we also don't\nassume that the iconv(1) executable exists.\n\nAn alternative strategy would be to introduce a new ICONV_EXECUTABLE\nprereq. But given that Git doesn't perform any kind of reencoding itself\nin case the ICONV support isn't built into it I found it to not be worth\nthe additional hassle.\n\nIn any case, this patch series causes the MSVC jobs to pass again on\nGitLab CI.\n\nChanges in v2:\n  - Extend the ICONV prerequisite to cover the new semantics and add a\n    NEEDSWORK comment.\n  - Mention the upstream issue in Git for Windows.\n  - Link to v1: https://lore.kernel.org/r/20260209-b4-pks-ci-msvc-iconv-fixes-v1-0-1e3167cd8828@pks.im\n\nThanks!\n\nPatrick\n\n---\nPatrick Steinhardt (4):\n      t4xxx: don't use iconv(1) without ICONV prereq\n      t4205: improve handling of ICONV prerequisite\n      t5550: add ICONV prereq to tests that use \"$HTTPD_URL/error\"\n      t6006: don't use iconv(1) without ICONV prereq\n\n t/t4041-diff-submodule-option.sh             |  8 +++--\n t/t4059-diff-submodule-not-initialized.sh    |  8 +++--\n t/t4060-diff-submodule-option-diff-format.sh |  8 +++--\n t/t4205-log-pretty-formats.sh                | 50 ++++++++++++++++------------\n t/t5550-http-fetch-dumb.sh                   | 20 +++++------\n t/t6006-rev-list-format.sh                   | 29 +++++++++++-----\n t/test-lib.sh                                | 12 ++++++-\n 7 files changed, 88 insertions(+), 47 deletions(-)\n\nRange-diff versus v1:\n\n1:  66ae888b34 ! 1:  0e26fa0f07 t4xxx: don't use iconv(1) without ICONV prereq\n    @@ Commit message\n         the first place, as we would only use it to convert from UTF-8 to UTF-8,\n         which should be equivalent to a no-op.\n     \n    +    In fact, Git for Windows has recently (unintentionally) shipped a change\n    +    where the iconv(1) binary is not getting installed anymore [1]. And as\n    +    we use Git for Windows directly in MSVC+Meson jobs in GitLab CI this has\n    +    exposed the issue. The missing iconv(1) binary is considered a bug that\n    +    will be fixed in Git for Windows, but regardless of that it makes sense\n    +    to not assume the binary to always exist.\n    +\n         Fix the issue and skip the call to iconv(1) in case the prerequisite is\n         not set. This makes tests work on systems that don't have iconv at all.\n    +    Extend the ICONV prerequisite to cover these new semantics so that we\n    +    know to skip tests in case the iconv(1) binary doesn't exist.\n     \n    -    Note that arguably, it's even unsafe to assume that the iconv(1)\n    -    executable exists only because Git has been built with support for it.\n    -    A more wholistic approach would thus be to split up the ICONV prereq\n    -    into two prereqs: one that tells us whether Git has been built with\n    -    ICONV support, and one that tells us whether the iconv(1) executable\n    -    exists. But that would lead to a bunch of changes throughout our tests,\n    -    and for arguably negligible benefit.\n    +    [1]: https://github.com/git-for-windows/git/issues/6083\n     \n         Signed-off-by: Patrick Steinhardt <ps@pks.im>\n     \n    @@ t/t4060-diff-submodule-option-diff-format.sh: add_file () {\n      \t\tdone >/dev/null &&\n      \t\tgit rev-parse --short --verify HEAD\n      \t)\n    +\n    + ## t/test-lib.sh ##\n    +@@ t/test-lib.sh: esac\n    + ( COLUMNS=1 && test $COLUMNS = 1 ) && test_set_prereq COLUMNS_CAN_BE_1\n    + test -z \"$NO_CURL\" && test_set_prereq LIBCURL\n    + test -z \"$NO_GITWEB\" && test_set_prereq GITWEB\n    +-test -z \"$NO_ICONV\" && test_set_prereq ICONV\n    + test -z \"$NO_PERL\" && test_set_prereq PERL\n    + test -z \"$NO_PTHREADS\" && test_set_prereq PTHREADS\n    + test -z \"$NO_PYTHON\" && test_set_prereq PYTHON\n    +@@ t/test-lib.sh: test -n \"$SANITIZE_LEAK\" && test_set_prereq SANITIZE_LEAK\n    + test -n \"$GIT_VALGRIND_ENABLED\" && test_set_prereq VALGRIND\n    + test -n \"$PERL_PATH\" && test_set_prereq PERL_TEST_HELPERS\n    + \n    ++test_lazy_prereq ICONV '\n    ++\t# We require Git to be built with iconv support, and we require the\n    ++\t# iconv binary to exist.\n    ++\t#\n    ++\t# NEEDSWORK: We might eventually want to split this up into two\n    ++\t# prerequisites: one for NO_ICONV, and one for the iconv(1) binary, as\n    ++\t# some tests only depend on either of these.\n    ++\ttest -z \"$NO_ICONV\" &&\n    ++\ticonv -f utf8 -t utf8 </dev/null\n    ++'\n    ++\n    + if test -z \"$GIT_TEST_CHECK_CACHE_TREE\"\n    + then\n    + \tGIT_TEST_CHECK_CACHE_TREE=true\n2:  d5831c230e = 2:  ae4d582c53 t4205: improve handling of ICONV prerequisite\n3:  a55d3b7ed4 = 3:  3c28d86b25 t5550: add ICONV prereq to tests that use \"$HTTPD_URL/error\"\n4:  28306e7c1e = 4:  b1f05d7725 t6006: don't use iconv(1) without ICONV prereq\n\n---\nbase-commit: 3e0db84c88c57e70ac8be8c196dfa92c5d656fbc\nchange-id: 20260209-b4-pks-ci-msvc-iconv-fixes-13de4801643f\n\n"},{"id":"536185","messageId":"20260217-b4-pks-ci-msvc-iconv-fixes-v2-1-25491bc8dbf8@pks.im","threadId":"64957","inReplyTo":"20260217-b4-pks-ci-msvc-iconv-fixes-v2-0-25491bc8dbf8@pks.im","subject":"[PATCH v2 1/4] t4xxx: don't use iconv(1) without ICONV prereq","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2026-02-17T13:58:27Z","receivedAt":"2026-02-17T13:58:35Z","isPatch":true,"sender":{"key":"ps@pks.im","avatar":"https://avatars.githubusercontent.com/u/4056630?v=4"},"body":"We've got a couple of tests that all use the iconv(1) executable to\nconvert the encoding of a commit message. All of these tests are\nprepared to handle a missing ICONV prereq, in which case they will\nsimply use UTF-8 encoding.\n\nBut even if the ICONV prerequisite has failed we try to use the iconv(1)\nexecutable. But it's not a safe to assume that the executable exists in\nthat case. And besides that, it's also unnecessary to use iconv(1) in\nthe first place, as we would only use it to convert from UTF-8 to UTF-8,\nwhich should be equivalent to a no-op.\n\nIn fact, Git for Windows has recently (unintentionally) shipped a change\nwhere the iconv(1) binary is not getting installed anymore [1]. And as\nwe use Git for Windows directly in MSVC+Meson jobs in GitLab CI this has\nexposed the issue. The missing iconv(1) binary is considered a bug that\nwill be fixed in Git for Windows, but regardless of that it makes sense\nto not assume the binary to always exist.\n\nFix the issue and skip the call to iconv(1) in case the prerequisite is\nnot set. This makes tests work on systems that don't have iconv at all.\nExtend the ICONV prerequisite to cover these new semantics so that we\nknow to skip tests in case the iconv(1) binary doesn't exist.\n\n[1]: https://github.com/git-for-windows/git/issues/6083\n\nSigned-off-by: Patrick Steinhardt <ps@pks.im>\n---\n t/t4041-diff-submodule-option.sh             |  8 ++++++--\n t/t4059-diff-submodule-not-initialized.sh    |  8 ++++++--\n t/t4060-diff-submodule-option-diff-format.sh |  8 ++++++--\n t/test-lib.sh                                | 12 +++++++++++-\n 4 files changed, 29 insertions(+), 7 deletions(-)\n\ndiff --git a/t/t4041-diff-submodule-option.sh b/t/t4041-diff-submodule-option.sh\nindex 4d4aa1650f..4dd4954260 100755\n--- a/t/t4041-diff-submodule-option.sh\n+++ b/t/t4041-diff-submodule-option.sh\n@@ -37,8 +37,12 @@ add_file () {\n \t\t\ttest_tick &&\n \t\t\t# \"git commit -m\" would break MinGW, as Windows refuse to pass\n \t\t\t# $test_encoding encoded parameter to git.\n-\t\t\techo \"Add $name ($added $name)\" | iconv -f utf-8 -t $test_encoding |\n-\t\t\tgit -c \"i18n.commitEncoding=$test_encoding\" commit -F -\n+\t\t\tmessage=\"Add $name ($added $name)\" &&\n+\t\t\tif test_have_prereq ICONV\n+\t\t\tthen\n+\t\t\t\tmessage=$(echo \"$message\" | iconv -f utf-8 -t $test_encoding)\n+\t\t\tfi &&\n+\t\t\techo \"$message\" | git -c \"i18n.commitEncoding=$test_encoding\" commit -F -\n \t\tdone >/dev/null &&\n \t\tgit rev-parse --short --verify HEAD\n \t)\ndiff --git a/t/t4059-diff-submodule-not-initialized.sh b/t/t4059-diff-submodule-not-initialized.sh\nindex 0fe81056d5..bb902ce94d 100755\n--- a/t/t4059-diff-submodule-not-initialized.sh\n+++ b/t/t4059-diff-submodule-not-initialized.sh\n@@ -35,8 +35,12 @@ add_file () {\n \t\t\ttest_tick &&\n \t\t\t# \"git commit -m\" would break MinGW, as Windows refuse to pass\n \t\t\t# $test_encoding encoded parameter to git.\n-\t\t\techo \"Add $name ($added $name)\" | iconv -f utf-8 -t $test_encoding |\n-\t\t\tgit -c \"i18n.commitEncoding=$test_encoding\" commit -F -\n+\t\t\tmessage=\"Add $name ($added $name)\" &&\n+\t\t\tif test_have_prereq ICONV\n+\t\t\tthen\n+\t\t\t\tmessage=$(echo \"$message\" | iconv -f utf-8 -t $test_encoding)\n+\t\t\tfi &&\n+\t\t\techo \"$message\" | git -c \"i18n.commitEncoding=$test_encoding\" commit -F -\n \t\tdone >/dev/null &&\n \t\tgit rev-parse --short --verify HEAD\n \t)\ndiff --git a/t/t4060-diff-submodule-option-diff-format.sh b/t/t4060-diff-submodule-option-diff-format.sh\nindex dbfeb7470b..d8f9213255 100755\n--- a/t/t4060-diff-submodule-option-diff-format.sh\n+++ b/t/t4060-diff-submodule-option-diff-format.sh\n@@ -35,8 +35,12 @@ add_file () {\n \t\t\ttest_tick &&\n \t\t\t# \"git commit -m\" would break MinGW, as Windows refuse to pass\n \t\t\t# $test_encoding encoded parameter to git.\n-\t\t\techo \"Add $name ($added $name)\" | iconv -f utf-8 -t $test_encoding |\n-\t\t\tgit -c \"i18n.commitEncoding=$test_encoding\" commit -F -\n+\t\t\tmessage=\"Add $name ($added $name)\" &&\n+\t\t\tif test_have_prereq ICONV\n+\t\t\tthen\n+\t\t\t\tmessage=$(echo \"$message\" | iconv -f utf-8 -t $test_encoding)\n+\t\t\tfi &&\n+\t\t\techo \"$message\" | git -c \"i18n.commitEncoding=$test_encoding\" commit -F -\n \t\tdone >/dev/null &&\n \t\tgit rev-parse --short --verify HEAD\n \t)\ndiff --git a/t/test-lib.sh b/t/test-lib.sh\nindex 0fb76f7d11..67d15ae079 100644\n--- a/t/test-lib.sh\n+++ b/t/test-lib.sh\n@@ -1720,7 +1720,6 @@ esac\n ( COLUMNS=1 && test $COLUMNS = 1 ) && test_set_prereq COLUMNS_CAN_BE_1\n test -z \"$NO_CURL\" && test_set_prereq LIBCURL\n test -z \"$NO_GITWEB\" && test_set_prereq GITWEB\n-test -z \"$NO_ICONV\" && test_set_prereq ICONV\n test -z \"$NO_PERL\" && test_set_prereq PERL\n test -z \"$NO_PTHREADS\" && test_set_prereq PTHREADS\n test -z \"$NO_PYTHON\" && test_set_prereq PYTHON\n@@ -1731,6 +1730,17 @@ test -n \"$SANITIZE_LEAK\" && test_set_prereq SANITIZE_LEAK\n test -n \"$GIT_VALGRIND_ENABLED\" && test_set_prereq VALGRIND\n test -n \"$PERL_PATH\" && test_set_prereq PERL_TEST_HELPERS\n \n+test_lazy_prereq ICONV '\n+\t# We require Git to be built with iconv support, and we require the\n+\t# iconv binary to exist.\n+\t#\n+\t# NEEDSWORK: We might eventually want to split this up into two\n+\t# prerequisites: one for NO_ICONV, and one for the iconv(1) binary, as\n+\t# some tests only depend on either of these.\n+\ttest -z \"$NO_ICONV\" &&\n+\ticonv -f utf8 -t utf8 </dev/null\n+'\n+\n if test -z \"$GIT_TEST_CHECK_CACHE_TREE\"\n then\n \tGIT_TEST_CHECK_CACHE_TREE=true\n\n-- \n2.53.0.352.gd1286b26eb.dirty\n\n"},{"id":"536186","messageId":"20260217-b4-pks-ci-msvc-iconv-fixes-v2-2-25491bc8dbf8@pks.im","threadId":"64957","inReplyTo":"20260217-b4-pks-ci-msvc-iconv-fixes-v2-0-25491bc8dbf8@pks.im","subject":"[PATCH v2 2/4] t4205: improve handling of ICONV prerequisite","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2026-02-17T13:58:28Z","receivedAt":"2026-02-17T13:58:39Z","isPatch":true,"sender":{"key":"ps@pks.im","avatar":"https://avatars.githubusercontent.com/u/4056630?v=4"},"body":"In t4205 we have a bunch of tests that depend on the iconv prereq. This\nis for most of the part because we format commit messages that have been\nencoded in an encoding different than UTF-8.\n\nThose tests fall into two classes though:\n\n  - One class of tests outputs the data as-is without reencoding.\n\n  - One class of tests outputs the data with \"i18n.logOutputEncoding\" to\n    reencode it.\n\nCuriously enough, both of these classes are marked with the ICONV\nprereq, even though one might expect that the first class wouldn't need\nthe prereq. This is because we unconditionally use ISO-8859-1 encoding\nfor the initial commit message, and thus we depend on converting to\nUTF-8 indeed.\n\nThis creates another problem though: when the iconv(1) executable does\nnot exist the test setup fails, even in the case where the ICONV prereq\nhas not been set.\n\nFix these issues by making the test encoding conditional on ICONV: if\nit's available we use ISO-8859-1, otherwise we use UTF-8. This fixes the\ntest setup on platforms without iconv(1), and it allows us to drop the\nICONV prereq from a bunch of tests.\n\nSigned-off-by: Patrick Steinhardt <ps@pks.im>\n---\n t/t4205-log-pretty-formats.sh | 50 ++++++++++++++++++++++++-------------------\n 1 file changed, 28 insertions(+), 22 deletions(-)\n\ndiff --git a/t/t4205-log-pretty-formats.sh b/t/t4205-log-pretty-formats.sh\nindex 8f2ba98963..3865f6abc7 100755\n--- a/t/t4205-log-pretty-formats.sh\n+++ b/t/t4205-log-pretty-formats.sh\n@@ -9,7 +9,12 @@ test_description='Test pretty formats'\n . ./test-lib.sh\n \n # Tested non-UTF-8 encoding\n-test_encoding=\"ISO8859-1\"\n+if test_have_prereq ICONV\n+then\n+\ttest_encoding=\"ISO8859-1\"\n+else\n+\ttest_encoding=\"UTF-8\"\n+fi\n \n sample_utf8_part=$(printf \"f\\303\\244ng\")\n \n@@ -18,7 +23,7 @@ commit_msg () {\n \t# (translated with Google Translate),\n \t# encoded in UTF-8, used as a commit log message below.\n \tmsg=\"initial. an${sample_utf8_part}lich\\n\"\n-\tif test -n \"$1\"\n+\tif test -n \"$1\" && test \"$1\" != \"UTF-8\"\n \tthen\n \t\tprintf \"$msg\" | iconv -f utf-8 -t \"$1\"\n \telse\n@@ -113,19 +118,19 @@ test_expect_success 'alias loop' '\n \ttest_must_fail git log --pretty=test-foo\n '\n \n-test_expect_success ICONV 'NUL separation' '\n+test_expect_success 'NUL separation' '\n \tprintf \"add bar\\0$(commit_msg)\" >expected &&\n \tgit log -z --pretty=\"format:%s\" >actual &&\n \ttest_cmp expected actual\n '\n \n-test_expect_success ICONV 'NUL termination' '\n+test_expect_success 'NUL termination' '\n \tprintf \"add bar\\0$(commit_msg)\\0\" >expected &&\n \tgit log -z --pretty=\"tformat:%s\" >actual &&\n \ttest_cmp expected actual\n '\n \n-test_expect_success ICONV 'NUL separation with --stat' '\n+test_expect_success 'NUL separation with --stat' '\n \tstat0_part=$(git diff --stat HEAD^ HEAD) &&\n \tstat1_part=$(git diff-tree --no-commit-id --stat --root HEAD^) &&\n \tprintf \"add bar\\n$stat0_part\\n\\0$(commit_msg)\\n$stat1_part\\n\" >expected &&\n@@ -180,7 +185,7 @@ test_expect_success 'setup more commits' '\n \thead4=$(git rev-parse --verify --short HEAD~3)\n '\n \n-test_expect_success ICONV 'left alignment formatting' '\n+test_expect_success 'left alignment formatting' '\n \tgit log --pretty=\"tformat:%<(40)%s\" >actual &&\n \tqz_to_tab_space <<-EOF >expected &&\n \tmessage two                            Z\n@@ -202,7 +207,7 @@ test_expect_success ICONV 'left alignment formatting. i18n.logOutputEncoding' '\n \ttest_cmp expected actual\n '\n \n-test_expect_success ICONV 'left alignment formatting at the nth column' '\n+test_expect_success 'left alignment formatting at the nth column' '\n \tgit log --pretty=\"tformat:%h %<|(40)%s\" >actual &&\n \tqz_to_tab_space <<-EOF >expected &&\n \t$head1 message two                    Z\n@@ -213,7 +218,7 @@ test_expect_success ICONV 'left alignment formatting at the nth column' '\n \ttest_cmp expected actual\n '\n \n-test_expect_success ICONV 'left alignment formatting at the nth column' '\n+test_expect_success 'left alignment formatting at the nth column' '\n \tCOLUMNS=50 git log --pretty=\"tformat:%h %<|(-10)%s\" >actual &&\n \tqz_to_tab_space <<-EOF >expected &&\n \t$head1 message two                    Z\n@@ -235,7 +240,7 @@ test_expect_success ICONV 'left alignment formatting at the nth column. i18n.log\n \ttest_cmp expected actual\n '\n \n-test_expect_success ICONV 'left alignment formatting with no padding' '\n+test_expect_success 'left alignment formatting with no padding' '\n \tgit log --pretty=\"tformat:%<(1)%s\" >actual &&\n \tcat <<-EOF >expected &&\n \tmessage two\n@@ -246,7 +251,7 @@ test_expect_success ICONV 'left alignment formatting with no padding' '\n \ttest_cmp expected actual\n '\n \n-test_expect_success 'left alignment formatting with no padding. i18n.logOutputEncoding' '\n+test_expect_success ICONV 'left alignment formatting with no padding. i18n.logOutputEncoding' '\n \tgit -c i18n.logOutputEncoding=$test_encoding log --pretty=\"tformat:%<(1)%s\" >actual &&\n \tcat <<-EOF | iconv -f utf-8 -t $test_encoding >expected &&\n \tmessage two\n@@ -257,7 +262,7 @@ test_expect_success 'left alignment formatting with no padding. i18n.logOutputEn\n \ttest_cmp expected actual\n '\n \n-test_expect_success ICONV 'left alignment formatting with trunc' '\n+test_expect_success 'left alignment formatting with trunc' '\n \tgit log --pretty=\"tformat:%<(10,trunc)%s\" >actual &&\n \tqz_to_tab_space <<-\\EOF >expected &&\n \tmessage ..\n@@ -279,7 +284,7 @@ test_expect_success ICONV 'left alignment formatting with trunc. i18n.logOutputE\n \ttest_cmp expected actual\n '\n \n-test_expect_success ICONV 'left alignment formatting with ltrunc' '\n+test_expect_success 'left alignment formatting with ltrunc' '\n \tgit log --pretty=\"tformat:%<(10,ltrunc)%s\" >actual &&\n \tqz_to_tab_space <<-EOF >expected &&\n \t..sage two\n@@ -301,7 +306,7 @@ test_expect_success ICONV 'left alignment formatting with ltrunc. i18n.logOutput\n \ttest_cmp expected actual\n '\n \n-test_expect_success ICONV 'left alignment formatting with mtrunc' '\n+test_expect_success 'left alignment formatting with mtrunc' '\n \tgit log --pretty=\"tformat:%<(10,mtrunc)%s\" >actual &&\n \tqz_to_tab_space <<-\\EOF >expected &&\n \tmess.. two\n@@ -323,7 +328,7 @@ test_expect_success ICONV 'left alignment formatting with mtrunc. i18n.logOutput\n \ttest_cmp expected actual\n '\n \n-test_expect_success ICONV 'right alignment formatting' '\n+test_expect_success 'right alignment formatting' '\n \tgit log --pretty=\"tformat:%>(40)%s\" >actual &&\n \tqz_to_tab_space <<-EOF >expected &&\n \tZ                            message two\n@@ -345,7 +350,7 @@ test_expect_success ICONV 'right alignment formatting. i18n.logOutputEncoding' '\n \ttest_cmp expected actual\n '\n \n-test_expect_success ICONV 'right alignment formatting at the nth column' '\n+test_expect_success 'right alignment formatting at the nth column' '\n \tgit log --pretty=\"tformat:%h %>|(40)%s\" >actual &&\n \tqz_to_tab_space <<-EOF >expected &&\n \t$head1                      message two\n@@ -356,7 +361,7 @@ test_expect_success ICONV 'right alignment formatting at the nth column' '\n \ttest_cmp expected actual\n '\n \n-test_expect_success ICONV 'right alignment formatting at the nth column' '\n+test_expect_success 'right alignment formatting at the nth column' '\n \tCOLUMNS=50 git log --pretty=\"tformat:%h %>|(-10)%s\" >actual &&\n \tqz_to_tab_space <<-EOF >expected &&\n \t$head1                      message two\n@@ -391,7 +396,7 @@ test_expect_success ICONV 'right alignment formatting at the nth column with --g\n \ttest_cmp expected actual\n '\n \n-test_expect_success ICONV 'right alignment formatting with no padding' '\n+test_expect_success 'right alignment formatting with no padding' '\n \tgit log --pretty=\"tformat:%>(1)%s\" >actual &&\n \tcat <<-EOF >expected &&\n \tmessage two\n@@ -402,7 +407,7 @@ test_expect_success ICONV 'right alignment formatting with no padding' '\n \ttest_cmp expected actual\n '\n \n-test_expect_success ICONV 'right alignment formatting with no padding and with --graph' '\n+test_expect_success 'right alignment formatting with no padding and with --graph' '\n \tgit log --graph --pretty=\"tformat:%>(1)%s\" >actual &&\n \tcat <<-EOF >expected &&\n \t* message two\n@@ -424,7 +429,7 @@ test_expect_success ICONV 'right alignment formatting with no padding. i18n.logO\n \ttest_cmp expected actual\n '\n \n-test_expect_success ICONV 'center alignment formatting' '\n+test_expect_success 'center alignment formatting' '\n \tgit log --pretty=\"tformat:%><(40)%s\" >actual &&\n \tqz_to_tab_space <<-EOF >expected &&\n \tZ             message two              Z\n@@ -445,7 +450,8 @@ test_expect_success ICONV 'center alignment formatting. i18n.logOutputEncoding'\n \tEOF\n \ttest_cmp expected actual\n '\n-test_expect_success ICONV 'center alignment formatting at the nth column' '\n+\n+test_expect_success 'center alignment formatting at the nth column' '\n \tgit log --pretty=\"tformat:%h %><|(40)%s\" >actual &&\n \tqz_to_tab_space <<-EOF >expected &&\n \t$head1           message two          Z\n@@ -456,7 +462,7 @@ test_expect_success ICONV 'center alignment formatting at the nth column' '\n \ttest_cmp expected actual\n '\n \n-test_expect_success ICONV 'center alignment formatting at the nth column' '\n+test_expect_success 'center alignment formatting at the nth column' '\n \tCOLUMNS=70 git log --pretty=\"tformat:%h %><|(-30)%s\" >actual &&\n \tqz_to_tab_space <<-EOF >expected &&\n \t$head1           message two          Z\n@@ -478,7 +484,7 @@ test_expect_success ICONV 'center alignment formatting at the nth column. i18n.l\n \ttest_cmp expected actual\n '\n \n-test_expect_success ICONV 'center alignment formatting with no padding' '\n+test_expect_success 'center alignment formatting with no padding' '\n \tgit log --pretty=\"tformat:%><(1)%s\" >actual &&\n \tcat <<-EOF >expected &&\n \tmessage two\n\n-- \n2.53.0.352.gd1286b26eb.dirty\n\n"},{"id":"536187","messageId":"20260217-b4-pks-ci-msvc-iconv-fixes-v2-3-25491bc8dbf8@pks.im","threadId":"64957","inReplyTo":"20260217-b4-pks-ci-msvc-iconv-fixes-v2-0-25491bc8dbf8@pks.im","subject":"[PATCH v2 3/4] t5550: add ICONV prereq to tests that use \"$HTTPD_URL/error\"","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2026-02-17T13:58:29Z","receivedAt":"2026-02-17T13:58:41Z","isPatch":true,"sender":{"key":"ps@pks.im","avatar":"https://avatars.githubusercontent.com/u/4056630?v=4"},"body":"We've got a bunch of tests in t5550 that connect to \"$HTTPD_URL/error\"\nto ensure that error messages are proprely forwarded. This URL executes\nthe \"t/lib-httpd/error.sh\" script, which in turn depends on the iconv(1)\nexecutable to reencode the message.\n\nThis executable may not exist on platforms, which will make the tests\nfail. Guard them with the ICONV prereq to fix such failures.\n\nSigned-off-by: Patrick Steinhardt <ps@pks.im>\n---\n t/t5550-http-fetch-dumb.sh | 20 ++++++++++----------\n 1 file changed, 10 insertions(+), 10 deletions(-)\n\ndiff --git a/t/t5550-http-fetch-dumb.sh b/t/t5550-http-fetch-dumb.sh\nindex ed0ad66fad..55102e702c 100755\n--- a/t/t5550-http-fetch-dumb.sh\n+++ b/t/t5550-http-fetch-dumb.sh\n@@ -339,32 +339,32 @@ test_expect_success 'fetch can handle previously-fetched .idx files' '\n '\n \n test_expect_success 'did not use upload-pack service' '\n-\t! grep \"/git-upload-pack\" \"$HTTPD_ROOT_PATH/access.log\"\n+\t! test_grep \"/git-upload-pack\" \"$HTTPD_ROOT_PATH/access.log\"\n '\n \n-test_expect_success 'git client shows text/plain errors' '\n+test_expect_success ICONV 'git client shows text/plain errors' '\n \ttest_must_fail git clone \"$HTTPD_URL/error/text\" 2>stderr &&\n-\tgrep \"this is the error message\" stderr\n+\ttest_grep \"this is the error message\" stderr\n '\n \n-test_expect_success 'git client does not show html errors' '\n+test_expect_success ICONV 'git client does not show html errors' '\n \ttest_must_fail git clone \"$HTTPD_URL/error/html\" 2>stderr &&\n-\t! grep \"this is the error message\" stderr\n+\t! test_grep \"this is the error message\" stderr\n '\n \n-test_expect_success 'git client shows text/plain with a charset' '\n+test_expect_success ICONV 'git client shows text/plain with a charset' '\n \ttest_must_fail git clone \"$HTTPD_URL/error/charset\" 2>stderr &&\n-\tgrep \"this is the error message\" stderr\n+\ttest_grep \"this is the error message\" stderr\n '\n \n test_expect_success ICONV 'http error messages are reencoded' '\n \ttest_must_fail git clone \"$HTTPD_URL/error/utf16\" 2>stderr &&\n-\tgrep \"this is the error message\" stderr\n+\ttest_grep \"this is the error message\" stderr\n '\n \n test_expect_success ICONV 'reencoding is robust to whitespace oddities' '\n \ttest_must_fail git clone \"$HTTPD_URL/error/odd-spacing\" 2>stderr &&\n-\tgrep \"this is the error message\" stderr\n+\ttest_grep \"this is the error message\" stderr\n '\n \n check_language () {\n@@ -406,7 +406,7 @@ ja;q=0.95, zh;q=0.94, sv;q=0.93, pt;q=0.92, nb;q=0.91, *;q=0.90\" \\\n \n test_expect_success 'git client send an empty Accept-Language' '\n \tGIT_TRACE_CURL=true LANGUAGE= git ls-remote \"$HTTPD_URL/dumb/repo.git\" 2>stderr &&\n-\t! grep \"^=> Send header: Accept-Language:\" stderr\n+\t! test_grep \"^=> Send header: Accept-Language:\" stderr\n '\n \n test_expect_success 'remote-http complains cleanly about malformed urls' '\n\n-- \n2.53.0.352.gd1286b26eb.dirty\n\n"},{"id":"536188","messageId":"20260217-b4-pks-ci-msvc-iconv-fixes-v2-4-25491bc8dbf8@pks.im","threadId":"64957","inReplyTo":"20260217-b4-pks-ci-msvc-iconv-fixes-v2-0-25491bc8dbf8@pks.im","subject":"[PATCH v2 4/4] t6006: don't use iconv(1) without ICONV prereq","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2026-02-17T13:58:30Z","receivedAt":"2026-02-17T13:58:44Z","isPatch":true,"sender":{"key":"ps@pks.im","avatar":"https://avatars.githubusercontent.com/u/4056630?v=4"},"body":"Two tests in t6006 depend on the iconv(1) prerequisite to reencode a\ncommit message. This executable may not even exist though in case the\nprereq is not set, which will cause the tests to fail.\n\nFix this by using UTF-8 instead when the prereq is not set.\n\nSigned-off-by: Patrick Steinhardt <ps@pks.im>\n---\n t/t6006-rev-list-format.sh | 29 +++++++++++++++++++++--------\n 1 file changed, 21 insertions(+), 8 deletions(-)\n\ndiff --git a/t/t6006-rev-list-format.sh b/t/t6006-rev-list-format.sh\nindex eb93d68d7d..581984467d 100755\n--- a/t/t6006-rev-list-format.sh\n+++ b/t/t6006-rev-list-format.sh\n@@ -378,15 +378,23 @@ test_expect_success 'rev-list %C(auto,...) respects --color' '\n \ttest_cmp expect actual\n '\n \n-iconv -f utf-8 -t $test_encoding > commit-msg <<EOF\n-Test printing of complex bodies\n+test_expect_success 'setup complex body' '\n+\tmessage=$(cat <<-EOF\n+\tTest printing of complex bodies\n \n-This commit message is much longer than the others,\n-and it will be encoded in $test_encoding. We should therefore\n-include an ISO8859 character: ¡bueno!\n-EOF\n+\tThis commit message is much longer than the others,\n+\tand it will be encoded in $test_encoding. We should therefore\n+\tinclude an ISO8859 character: ¡bueno!\n+\tEOF\n+\t) &&\n+\n+\tif test_have_prereq ICONV\n+\tthen\n+\t\techo \"$message\" | iconv -f utf-8 -t $test_encoding >commit-msg\n+\telse\n+\t\techo \"$message\" >commit-msg\n+\tfi &&\n \n-test_expect_success 'setup complex body' '\n \tgit config i18n.commitencoding $test_encoding &&\n \techo change2 >foo && git commit -a -F commit-msg &&\n \thead3=$(git rev-parse --verify HEAD) &&\n@@ -448,7 +456,12 @@ test_expect_success 'setup expected messages (for test %b)' '\n \tcommit $head2\n \tcommit $head1\n \tEOF\n-\ticonv -f utf-8 -t $test_encoding expected.utf-8 >expected.ISO8859-1\n+\tif test_have_prereq ICONV\n+\tthen\n+\t\ticonv -f utf-8 -t $test_encoding expected.utf-8 >expected.ISO8859-1\n+\telse\n+\t\tcp expected.utf-8 expected.ISO8859-1\n+\tfi\n '\n \n test_format complex-body %b <expected.ISO8859-1\n\n-- \n2.53.0.352.gd1286b26eb.dirty\n\n"},{"id":"536189","messageId":"CAP8UFD23MdTF3qVFhDFBDcnqh4dqiehvFz_3c-keMhSOa92Dpw@mail.gmail.com","threadId":"64957","inReplyTo":"20260217-b4-pks-ci-msvc-iconv-fixes-v2-1-25491bc8dbf8@pks.im","subject":"Re: [PATCH v2 1/4] t4xxx: don't use iconv(1) without ICONV prereq","fromName":"Christian Couder","fromEmail":"christian.couder@gmail.com","sentAt":"2026-02-17T14:48:19Z","receivedAt":"2026-02-17T14:48:32Z","isPatch":true,"sender":{"key":"christian.couder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/208954?v=4"},"body":"On Tue, Feb 17, 2026 at 2:58 PM Patrick Steinhardt <ps@pks.im> wrote:\n>\n> We've got a couple of tests that all use the iconv(1) executable to\n> convert the encoding of a commit message. All of these tests are\n> prepared to handle a missing ICONV prereq, in which case they will\n> simply use UTF-8 encoding.\n>\n> But even if the ICONV prerequisite has failed we try to use the iconv(1)\n> executable. But it's not a safe to assume that the executable exists in\n\ns/not a safe/not safe/\n\n> that case. And besides that, it's also unnecessary to use iconv(1) in\n> the first place, as we would only use it to convert from UTF-8 to UTF-8,\n> which should be equivalent to a no-op.\n>\n> In fact, Git for Windows has recently (unintentionally) shipped a change\n> where the iconv(1) binary is not getting installed anymore [1]. And as\n> we use Git for Windows directly in MSVC+Meson jobs in GitLab CI this has\n> exposed the issue. The missing iconv(1) binary is considered a bug that\n> will be fixed in Git for Windows, but regardless of that it makes sense\n> to not assume the binary to always exist.\n>\n> Fix the issue and skip the call to iconv(1) in case the prerequisite is\n> not set. This makes tests work on systems that don't have iconv at all.\n\nNit: when reading this, it's not clear if this commit is enough to fix\nall the MSVC+Meson jobs in GitLab CI or only those related to the\nt4xxx tests.\n\n> Extend the ICONV prerequisite to cover these new semantics so that we\n> know to skip tests in case the iconv(1) binary doesn't exist.\n\n[...]\n\n> +test_lazy_prereq ICONV '\n> +       # We require Git to be built with iconv support, and we require the\n> +       # iconv binary to exist.\n> +       #\n> +       # NEEDSWORK: We might eventually want to split this up into two\n> +       # prerequisites: one for NO_ICONV, and one for the iconv(1) binary, as\n> +       # some tests only depend on either of these.\n> +       test -z \"$NO_ICONV\" &&\n> +       iconv -f utf8 -t utf8 </dev/null\n> +'\n\nYeah, I think it works to actually test if iconv works and to document\nthe small discrepancy between the ICONV prereq and NO_ICONV here.\n"},{"id":"536191","messageId":"aZSG31TB_Pprcq2a@pks.im","threadId":"64957","inReplyTo":"CAP8UFD23MdTF3qVFhDFBDcnqh4dqiehvFz_3c-keMhSOa92Dpw@mail.gmail.com","subject":"Re: [PATCH v2 1/4] t4xxx: don't use iconv(1) without ICONV prereq","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2026-02-17T15:18:55Z","receivedAt":"2026-02-17T15:19:04Z","isPatch":true,"sender":{"key":"ps@pks.im","avatar":"https://avatars.githubusercontent.com/u/4056630?v=4"},"body":"On Tue, Feb 17, 2026 at 03:48:19PM +0100, Christian Couder wrote:\n> On Tue, Feb 17, 2026 at 2:58 PM Patrick Steinhardt <ps@pks.im> wrote:\n> >\n> > We've got a couple of tests that all use the iconv(1) executable to\n> > convert the encoding of a commit message. All of these tests are\n> > prepared to handle a missing ICONV prereq, in which case they will\n> > simply use UTF-8 encoding.\n> >\n> > But even if the ICONV prerequisite has failed we try to use the iconv(1)\n> > executable. But it's not a safe to assume that the executable exists in\n> \n> s/not a safe/not safe/\n> \n> > that case. And besides that, it's also unnecessary to use iconv(1) in\n> > the first place, as we would only use it to convert from UTF-8 to UTF-8,\n> > which should be equivalent to a no-op.\n> >\n> > In fact, Git for Windows has recently (unintentionally) shipped a change\n> > where the iconv(1) binary is not getting installed anymore [1]. And as\n> > we use Git for Windows directly in MSVC+Meson jobs in GitLab CI this has\n> > exposed the issue. The missing iconv(1) binary is considered a bug that\n> > will be fixed in Git for Windows, but regardless of that it makes sense\n> > to not assume the binary to always exist.\n> >\n> > Fix the issue and skip the call to iconv(1) in case the prerequisite is\n> > not set. This makes tests work on systems that don't have iconv at all.\n> \n> Nit: when reading this, it's not clear if this commit is enough to fix\n> all the MSVC+Meson jobs in GitLab CI or only those related to the\n> t4xxx tests.\n\nYeah, fair. I think this is an artifact of me lumping these two changes\ntogether into a single commit. I'll split it up in v3 of this patch\nseries.\n\nThanks!\n\nPatrick\n"},{"id":"536247","messageId":"20260218-b4-pks-ci-msvc-iconv-fixes-v3-0-08c1ff3ffc9a@pks.im","threadId":"64957","inReplyTo":"20260209-b4-pks-ci-msvc-iconv-fixes-v1-0-1e3167cd8828@pks.im","subject":"[PATCH v3 0/5] Fix tests with missing iconv(1) executable","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2026-02-18T04:38:37Z","receivedAt":"2026-02-18T04:38:47Z","isPatch":true,"sender":{"key":"ps@pks.im","avatar":"https://avatars.githubusercontent.com/u/4056630?v=4"},"body":"Hi,\n\nI recently noticed that the MSVC-based tests in GitLab CI started to\nfail. The root cause is that the iconv(1) executable cannot be found on\nthis platform anymore. This isn't entirely surprising: we depend on the\nGit for Windows environment to provide necessary shell tools, and that\nenvironment of course is not a fully fledged MSYS2 installation.\n\nIn any case, this patch series fixes those issues by building on top of\nthe ICONV prerequisite. If the prereq isn't found, then we also don't\nassume that the iconv(1) executable exists.\n\nAn alternative strategy would be to introduce a new ICONV_EXECUTABLE\nprereq. But given that Git doesn't perform any kind of reencoding itself\nin case the ICONV support isn't built into it I found it to not be worth\nthe additional hassle.\n\nIn any case, this patch series causes the MSVC jobs to pass again on\nGitLab CI.\n\nChanges in v3:\n  - Split out the changes for the ICONV prerequisite into a standalone\n    commit.\n  - Link to v2: https://lore.kernel.org/r/20260217-b4-pks-ci-msvc-iconv-fixes-v2-0-25491bc8dbf8@pks.im\n\nChanges in v2:\n  - Extend the ICONV prerequisite to cover the new semantics and add a\n    NEEDSWORK comment.\n  - Mention the upstream issue in Git for Windows.\n  - Link to v1: https://lore.kernel.org/r/20260209-b4-pks-ci-msvc-iconv-fixes-v1-0-1e3167cd8828@pks.im\n\nThanks!\n\nPatrick\n\n---\nPatrick Steinhardt (5):\n      t: don't set ICONV prereq when iconv(1) is missing\n      t40xx: don't use iconv(1) without ICONV prereq\n      t4205: improve handling of ICONV prerequisite\n      t5550: add ICONV prereq to tests that use \"$HTTPD_URL/error\"\n      t6006: don't use iconv(1) without ICONV prereq\n\n t/t4041-diff-submodule-option.sh             |  8 +++--\n t/t4059-diff-submodule-not-initialized.sh    |  8 +++--\n t/t4060-diff-submodule-option-diff-format.sh |  8 +++--\n t/t4205-log-pretty-formats.sh                | 50 ++++++++++++++++------------\n t/t5550-http-fetch-dumb.sh                   | 20 +++++------\n t/t6006-rev-list-format.sh                   | 29 +++++++++++-----\n t/test-lib.sh                                | 12 ++++++-\n 7 files changed, 88 insertions(+), 47 deletions(-)\n\nRange-diff versus v2:\n\n-:  ---------- > 1:  74b9ab2ca1 t: don't set ICONV prereq when iconv(1) is missing\n1:  50bcd30389 ! 2:  f0461ca7cb t4xxx: don't use iconv(1) without ICONV prereq\n    @@ Metadata\n     Author: Patrick Steinhardt <ps@pks.im>\n     \n      ## Commit message ##\n    -    t4xxx: don't use iconv(1) without ICONV prereq\n    +    t40xx: don't use iconv(1) without ICONV prereq\n     \n    -    We've got a couple of tests that all use the iconv(1) executable to\n    -    convert the encoding of a commit message. All of these tests are\n    -    prepared to handle a missing ICONV prereq, in which case they will\n    -    simply use UTF-8 encoding.\n    +    We've got a couple of tests related to diffs in t40xx that use the\n    +    iconv(1) executable to convert the encoding of a commit message. All of\n    +    these tests are prepared to handle a missing ICONV prereq, in which case\n    +    they will simply use UTF-8 encoding.\n     \n         But even if the ICONV prerequisite has failed we try to use the iconv(1)\n    -    executable. But it's not a safe to assume that the executable exists in\n    -    that case. And besides that, it's also unnecessary to use iconv(1) in\n    -    the first place, as we would only use it to convert from UTF-8 to UTF-8,\n    -    which should be equivalent to a no-op.\n    -\n    -    In fact, Git for Windows has recently (unintentionally) shipped a change\n    -    where the iconv(1) binary is not getting installed anymore [1]. And as\n    -    we use Git for Windows directly in MSVC+Meson jobs in GitLab CI this has\n    -    exposed the issue. The missing iconv(1) binary is considered a bug that\n    -    will be fixed in Git for Windows, but regardless of that it makes sense\n    -    to not assume the binary to always exist.\n    +    executable, even though it's not safe to assume that the executable\n    +    exists in that case. And besides that, it's also unnecessary to use\n    +    iconv(1) in the first place, as we would only use it to convert from\n    +    UTF-8 to UTF-8, which should be equivalent to a no-op.\n     \n         Fix the issue and skip the call to iconv(1) in case the prerequisite is\n         not set. This makes tests work on systems that don't have iconv at all.\n    -    Extend the ICONV prerequisite to cover these new semantics so that we\n    -    know to skip tests in case the iconv(1) binary doesn't exist.\n    -\n    -    [1]: https://github.com/git-for-windows/git/issues/6083\n     \n         Signed-off-by: Patrick Steinhardt <ps@pks.im>\n     \n    @@ t/t4060-diff-submodule-option-diff-format.sh: add_file () {\n      \t\tdone >/dev/null &&\n      \t\tgit rev-parse --short --verify HEAD\n      \t)\n    -\n    - ## t/test-lib.sh ##\n    -@@ t/test-lib.sh: esac\n    - ( COLUMNS=1 && test $COLUMNS = 1 ) && test_set_prereq COLUMNS_CAN_BE_1\n    - test -z \"$NO_CURL\" && test_set_prereq LIBCURL\n    - test -z \"$NO_GITWEB\" && test_set_prereq GITWEB\n    --test -z \"$NO_ICONV\" && test_set_prereq ICONV\n    - test -z \"$NO_PERL\" && test_set_prereq PERL\n    - test -z \"$NO_PTHREADS\" && test_set_prereq PTHREADS\n    - test -z \"$NO_PYTHON\" && test_set_prereq PYTHON\n    -@@ t/test-lib.sh: test -n \"$SANITIZE_LEAK\" && test_set_prereq SANITIZE_LEAK\n    - test -n \"$GIT_VALGRIND_ENABLED\" && test_set_prereq VALGRIND\n    - test -n \"$PERL_PATH\" && test_set_prereq PERL_TEST_HELPERS\n    - \n    -+test_lazy_prereq ICONV '\n    -+\t# We require Git to be built with iconv support, and we require the\n    -+\t# iconv binary to exist.\n    -+\t#\n    -+\t# NEEDSWORK: We might eventually want to split this up into two\n    -+\t# prerequisites: one for NO_ICONV, and one for the iconv(1) binary, as\n    -+\t# some tests only depend on either of these.\n    -+\ttest -z \"$NO_ICONV\" &&\n    -+\ticonv -f utf8 -t utf8 </dev/null\n    -+'\n    -+\n    - if test -z \"$GIT_TEST_CHECK_CACHE_TREE\"\n    - then\n    - \tGIT_TEST_CHECK_CACHE_TREE=true\n2:  5b4e3270bc = 3:  cdbc1ca807 t4205: improve handling of ICONV prerequisite\n3:  60dfbaaf17 = 4:  3c66466ba4 t5550: add ICONV prereq to tests that use \"$HTTPD_URL/error\"\n4:  b29618e071 = 5:  0306f9d1f8 t6006: don't use iconv(1) without ICONV prereq\n\n---\nbase-commit: 3e0db84c88c57e70ac8be8c196dfa92c5d656fbc\nchange-id: 20260209-b4-pks-ci-msvc-iconv-fixes-13de4801643f\n\n"},{"id":"536248","messageId":"20260218-b4-pks-ci-msvc-iconv-fixes-v3-1-08c1ff3ffc9a@pks.im","threadId":"64957","inReplyTo":"20260218-b4-pks-ci-msvc-iconv-fixes-v3-0-08c1ff3ffc9a@pks.im","subject":"[PATCH v3 1/5] t: don't set ICONV prereq when iconv(1) is missing","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2026-02-18T04:38:38Z","receivedAt":"2026-02-18T04:38:48Z","isPatch":true,"sender":{"key":"ps@pks.im","avatar":"https://avatars.githubusercontent.com/u/4056630?v=4"},"body":"We've got a couple of tests that exercise Git with different encodings,\ntypically around commit messages. All of these tests depend on the ICONV\nprerequisite, which is set when Git was built with support for iconv.\n\nMany of those tests also end up using the iconv(1) executable to\nreencode text. But while tests can rely on the fact that Git does have\nsupport for iconv, they cannot assume that the iconv(1) executable\nexists. The consequence is thus that tests will break in case Git is\nbuilt with iconv, but the executable doesn't exist. In fact, some of the\ntests even use the iconv(1) executable unconditionally, regardless of\nwhether or not the ICONV prerequisite is set.\n\nGit for Windows has recently (unintentionally) shipped a change where\nthe iconv(1) binary is not getting installed anymore [1]. And as we use\nGit for Windows directly in MSVC+Meson jobs in GitLab CI this has caused\nsuch tests to break. The missing iconv(1) binary is considered a bug\nthat will be fixed in Git for Windows. But regardless of that it makes\nsense to not assume the binary to always exist so that our test suite\npasses on platforms that don't have iconv at all.\n\nExtend the ICONV prerequisite so that we know to skip tests in case the\niconv(1) binary doesn't exist. We'll adapt tests that are currently\nbroken in subsequent commits.\n\n[1]: https://github.com/git-for-windows/git/issues/6083\n\nSigned-off-by: Patrick Steinhardt <ps@pks.im>\n---\n t/test-lib.sh | 12 +++++++++++-\n 1 file changed, 11 insertions(+), 1 deletion(-)\n\ndiff --git a/t/test-lib.sh b/t/test-lib.sh\nindex 0fb76f7d11..67d15ae079 100644\n--- a/t/test-lib.sh\n+++ b/t/test-lib.sh\n@@ -1720,7 +1720,6 @@ esac\n ( COLUMNS=1 && test $COLUMNS = 1 ) && test_set_prereq COLUMNS_CAN_BE_1\n test -z \"$NO_CURL\" && test_set_prereq LIBCURL\n test -z \"$NO_GITWEB\" && test_set_prereq GITWEB\n-test -z \"$NO_ICONV\" && test_set_prereq ICONV\n test -z \"$NO_PERL\" && test_set_prereq PERL\n test -z \"$NO_PTHREADS\" && test_set_prereq PTHREADS\n test -z \"$NO_PYTHON\" && test_set_prereq PYTHON\n@@ -1731,6 +1730,17 @@ test -n \"$SANITIZE_LEAK\" && test_set_prereq SANITIZE_LEAK\n test -n \"$GIT_VALGRIND_ENABLED\" && test_set_prereq VALGRIND\n test -n \"$PERL_PATH\" && test_set_prereq PERL_TEST_HELPERS\n \n+test_lazy_prereq ICONV '\n+\t# We require Git to be built with iconv support, and we require the\n+\t# iconv binary to exist.\n+\t#\n+\t# NEEDSWORK: We might eventually want to split this up into two\n+\t# prerequisites: one for NO_ICONV, and one for the iconv(1) binary, as\n+\t# some tests only depend on either of these.\n+\ttest -z \"$NO_ICONV\" &&\n+\ticonv -f utf8 -t utf8 </dev/null\n+'\n+\n if test -z \"$GIT_TEST_CHECK_CACHE_TREE\"\n then\n \tGIT_TEST_CHECK_CACHE_TREE=true\n\n-- \n2.53.0.414.gf7e9f6c205.dirty\n\n"},{"id":"536249","messageId":"20260218-b4-pks-ci-msvc-iconv-fixes-v3-2-08c1ff3ffc9a@pks.im","threadId":"64957","inReplyTo":"20260218-b4-pks-ci-msvc-iconv-fixes-v3-0-08c1ff3ffc9a@pks.im","subject":"[PATCH v3 2/5] t40xx: don't use iconv(1) without ICONV prereq","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2026-02-18T04:38:39Z","receivedAt":"2026-02-18T04:38:51Z","isPatch":true,"sender":{"key":"ps@pks.im","avatar":"https://avatars.githubusercontent.com/u/4056630?v=4"},"body":"We've got a couple of tests related to diffs in t40xx that use the\niconv(1) executable to convert the encoding of a commit message. All of\nthese tests are prepared to handle a missing ICONV prereq, in which case\nthey will simply use UTF-8 encoding.\n\nBut even if the ICONV prerequisite has failed we try to use the iconv(1)\nexecutable, even though it's not safe to assume that the executable\nexists in that case. And besides that, it's also unnecessary to use\niconv(1) in the first place, as we would only use it to convert from\nUTF-8 to UTF-8, which should be equivalent to a no-op.\n\nFix the issue and skip the call to iconv(1) in case the prerequisite is\nnot set. This makes tests work on systems that don't have iconv at all.\n\nSigned-off-by: Patrick Steinhardt <ps@pks.im>\n---\n t/t4041-diff-submodule-option.sh             | 8 ++++++--\n t/t4059-diff-submodule-not-initialized.sh    | 8 ++++++--\n t/t4060-diff-submodule-option-diff-format.sh | 8 ++++++--\n 3 files changed, 18 insertions(+), 6 deletions(-)\n\ndiff --git a/t/t4041-diff-submodule-option.sh b/t/t4041-diff-submodule-option.sh\nindex 4d4aa1650f..4dd4954260 100755\n--- a/t/t4041-diff-submodule-option.sh\n+++ b/t/t4041-diff-submodule-option.sh\n@@ -37,8 +37,12 @@ add_file () {\n \t\t\ttest_tick &&\n \t\t\t# \"git commit -m\" would break MinGW, as Windows refuse to pass\n \t\t\t# $test_encoding encoded parameter to git.\n-\t\t\techo \"Add $name ($added $name)\" | iconv -f utf-8 -t $test_encoding |\n-\t\t\tgit -c \"i18n.commitEncoding=$test_encoding\" commit -F -\n+\t\t\tmessage=\"Add $name ($added $name)\" &&\n+\t\t\tif test_have_prereq ICONV\n+\t\t\tthen\n+\t\t\t\tmessage=$(echo \"$message\" | iconv -f utf-8 -t $test_encoding)\n+\t\t\tfi &&\n+\t\t\techo \"$message\" | git -c \"i18n.commitEncoding=$test_encoding\" commit -F -\n \t\tdone >/dev/null &&\n \t\tgit rev-parse --short --verify HEAD\n \t)\ndiff --git a/t/t4059-diff-submodule-not-initialized.sh b/t/t4059-diff-submodule-not-initialized.sh\nindex 0fe81056d5..bb902ce94d 100755\n--- a/t/t4059-diff-submodule-not-initialized.sh\n+++ b/t/t4059-diff-submodule-not-initialized.sh\n@@ -35,8 +35,12 @@ add_file () {\n \t\t\ttest_tick &&\n \t\t\t# \"git commit -m\" would break MinGW, as Windows refuse to pass\n \t\t\t# $test_encoding encoded parameter to git.\n-\t\t\techo \"Add $name ($added $name)\" | iconv -f utf-8 -t $test_encoding |\n-\t\t\tgit -c \"i18n.commitEncoding=$test_encoding\" commit -F -\n+\t\t\tmessage=\"Add $name ($added $name)\" &&\n+\t\t\tif test_have_prereq ICONV\n+\t\t\tthen\n+\t\t\t\tmessage=$(echo \"$message\" | iconv -f utf-8 -t $test_encoding)\n+\t\t\tfi &&\n+\t\t\techo \"$message\" | git -c \"i18n.commitEncoding=$test_encoding\" commit -F -\n \t\tdone >/dev/null &&\n \t\tgit rev-parse --short --verify HEAD\n \t)\ndiff --git a/t/t4060-diff-submodule-option-diff-format.sh b/t/t4060-diff-submodule-option-diff-format.sh\nindex dbfeb7470b..d8f9213255 100755\n--- a/t/t4060-diff-submodule-option-diff-format.sh\n+++ b/t/t4060-diff-submodule-option-diff-format.sh\n@@ -35,8 +35,12 @@ add_file () {\n \t\t\ttest_tick &&\n \t\t\t# \"git commit -m\" would break MinGW, as Windows refuse to pass\n \t\t\t# $test_encoding encoded parameter to git.\n-\t\t\techo \"Add $name ($added $name)\" | iconv -f utf-8 -t $test_encoding |\n-\t\t\tgit -c \"i18n.commitEncoding=$test_encoding\" commit -F -\n+\t\t\tmessage=\"Add $name ($added $name)\" &&\n+\t\t\tif test_have_prereq ICONV\n+\t\t\tthen\n+\t\t\t\tmessage=$(echo \"$message\" | iconv -f utf-8 -t $test_encoding)\n+\t\t\tfi &&\n+\t\t\techo \"$message\" | git -c \"i18n.commitEncoding=$test_encoding\" commit -F -\n \t\tdone >/dev/null &&\n \t\tgit rev-parse --short --verify HEAD\n \t)\n\n-- \n2.53.0.414.gf7e9f6c205.dirty\n\n"},{"id":"536250","messageId":"20260218-b4-pks-ci-msvc-iconv-fixes-v3-3-08c1ff3ffc9a@pks.im","threadId":"64957","inReplyTo":"20260218-b4-pks-ci-msvc-iconv-fixes-v3-0-08c1ff3ffc9a@pks.im","subject":"[PATCH v3 3/5] t4205: improve handling of ICONV prerequisite","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2026-02-18T04:38:40Z","receivedAt":"2026-02-18T04:38:54Z","isPatch":true,"sender":{"key":"ps@pks.im","avatar":"https://avatars.githubusercontent.com/u/4056630?v=4"},"body":"In t4205 we have a bunch of tests that depend on the iconv prereq. This\nis for most of the part because we format commit messages that have been\nencoded in an encoding different than UTF-8.\n\nThose tests fall into two classes though:\n\n  - One class of tests outputs the data as-is without reencoding.\n\n  - One class of tests outputs the data with \"i18n.logOutputEncoding\" to\n    reencode it.\n\nCuriously enough, both of these classes are marked with the ICONV\nprereq, even though one might expect that the first class wouldn't need\nthe prereq. This is because we unconditionally use ISO-8859-1 encoding\nfor the initial commit message, and thus we depend on converting to\nUTF-8 indeed.\n\nThis creates another problem though: when the iconv(1) executable does\nnot exist the test setup fails, even in the case where the ICONV prereq\nhas not been set.\n\nFix these issues by making the test encoding conditional on ICONV: if\nit's available we use ISO-8859-1, otherwise we use UTF-8. This fixes the\ntest setup on platforms without iconv(1), and it allows us to drop the\nICONV prereq from a bunch of tests.\n\nSigned-off-by: Patrick Steinhardt <ps@pks.im>\n---\n t/t4205-log-pretty-formats.sh | 50 ++++++++++++++++++++++++-------------------\n 1 file changed, 28 insertions(+), 22 deletions(-)\n\ndiff --git a/t/t4205-log-pretty-formats.sh b/t/t4205-log-pretty-formats.sh\nindex 8f2ba98963..3865f6abc7 100755\n--- a/t/t4205-log-pretty-formats.sh\n+++ b/t/t4205-log-pretty-formats.sh\n@@ -9,7 +9,12 @@ test_description='Test pretty formats'\n . ./test-lib.sh\n \n # Tested non-UTF-8 encoding\n-test_encoding=\"ISO8859-1\"\n+if test_have_prereq ICONV\n+then\n+\ttest_encoding=\"ISO8859-1\"\n+else\n+\ttest_encoding=\"UTF-8\"\n+fi\n \n sample_utf8_part=$(printf \"f\\303\\244ng\")\n \n@@ -18,7 +23,7 @@ commit_msg () {\n \t# (translated with Google Translate),\n \t# encoded in UTF-8, used as a commit log message below.\n \tmsg=\"initial. an${sample_utf8_part}lich\\n\"\n-\tif test -n \"$1\"\n+\tif test -n \"$1\" && test \"$1\" != \"UTF-8\"\n \tthen\n \t\tprintf \"$msg\" | iconv -f utf-8 -t \"$1\"\n \telse\n@@ -113,19 +118,19 @@ test_expect_success 'alias loop' '\n \ttest_must_fail git log --pretty=test-foo\n '\n \n-test_expect_success ICONV 'NUL separation' '\n+test_expect_success 'NUL separation' '\n \tprintf \"add bar\\0$(commit_msg)\" >expected &&\n \tgit log -z --pretty=\"format:%s\" >actual &&\n \ttest_cmp expected actual\n '\n \n-test_expect_success ICONV 'NUL termination' '\n+test_expect_success 'NUL termination' '\n \tprintf \"add bar\\0$(commit_msg)\\0\" >expected &&\n \tgit log -z --pretty=\"tformat:%s\" >actual &&\n \ttest_cmp expected actual\n '\n \n-test_expect_success ICONV 'NUL separation with --stat' '\n+test_expect_success 'NUL separation with --stat' '\n \tstat0_part=$(git diff --stat HEAD^ HEAD) &&\n \tstat1_part=$(git diff-tree --no-commit-id --stat --root HEAD^) &&\n \tprintf \"add bar\\n$stat0_part\\n\\0$(commit_msg)\\n$stat1_part\\n\" >expected &&\n@@ -180,7 +185,7 @@ test_expect_success 'setup more commits' '\n \thead4=$(git rev-parse --verify --short HEAD~3)\n '\n \n-test_expect_success ICONV 'left alignment formatting' '\n+test_expect_success 'left alignment formatting' '\n \tgit log --pretty=\"tformat:%<(40)%s\" >actual &&\n \tqz_to_tab_space <<-EOF >expected &&\n \tmessage two                            Z\n@@ -202,7 +207,7 @@ test_expect_success ICONV 'left alignment formatting. i18n.logOutputEncoding' '\n \ttest_cmp expected actual\n '\n \n-test_expect_success ICONV 'left alignment formatting at the nth column' '\n+test_expect_success 'left alignment formatting at the nth column' '\n \tgit log --pretty=\"tformat:%h %<|(40)%s\" >actual &&\n \tqz_to_tab_space <<-EOF >expected &&\n \t$head1 message two                    Z\n@@ -213,7 +218,7 @@ test_expect_success ICONV 'left alignment formatting at the nth column' '\n \ttest_cmp expected actual\n '\n \n-test_expect_success ICONV 'left alignment formatting at the nth column' '\n+test_expect_success 'left alignment formatting at the nth column' '\n \tCOLUMNS=50 git log --pretty=\"tformat:%h %<|(-10)%s\" >actual &&\n \tqz_to_tab_space <<-EOF >expected &&\n \t$head1 message two                    Z\n@@ -235,7 +240,7 @@ test_expect_success ICONV 'left alignment formatting at the nth column. i18n.log\n \ttest_cmp expected actual\n '\n \n-test_expect_success ICONV 'left alignment formatting with no padding' '\n+test_expect_success 'left alignment formatting with no padding' '\n \tgit log --pretty=\"tformat:%<(1)%s\" >actual &&\n \tcat <<-EOF >expected &&\n \tmessage two\n@@ -246,7 +251,7 @@ test_expect_success ICONV 'left alignment formatting with no padding' '\n \ttest_cmp expected actual\n '\n \n-test_expect_success 'left alignment formatting with no padding. i18n.logOutputEncoding' '\n+test_expect_success ICONV 'left alignment formatting with no padding. i18n.logOutputEncoding' '\n \tgit -c i18n.logOutputEncoding=$test_encoding log --pretty=\"tformat:%<(1)%s\" >actual &&\n \tcat <<-EOF | iconv -f utf-8 -t $test_encoding >expected &&\n \tmessage two\n@@ -257,7 +262,7 @@ test_expect_success 'left alignment formatting with no padding. i18n.logOutputEn\n \ttest_cmp expected actual\n '\n \n-test_expect_success ICONV 'left alignment formatting with trunc' '\n+test_expect_success 'left alignment formatting with trunc' '\n \tgit log --pretty=\"tformat:%<(10,trunc)%s\" >actual &&\n \tqz_to_tab_space <<-\\EOF >expected &&\n \tmessage ..\n@@ -279,7 +284,7 @@ test_expect_success ICONV 'left alignment formatting with trunc. i18n.logOutputE\n \ttest_cmp expected actual\n '\n \n-test_expect_success ICONV 'left alignment formatting with ltrunc' '\n+test_expect_success 'left alignment formatting with ltrunc' '\n \tgit log --pretty=\"tformat:%<(10,ltrunc)%s\" >actual &&\n \tqz_to_tab_space <<-EOF >expected &&\n \t..sage two\n@@ -301,7 +306,7 @@ test_expect_success ICONV 'left alignment formatting with ltrunc. i18n.logOutput\n \ttest_cmp expected actual\n '\n \n-test_expect_success ICONV 'left alignment formatting with mtrunc' '\n+test_expect_success 'left alignment formatting with mtrunc' '\n \tgit log --pretty=\"tformat:%<(10,mtrunc)%s\" >actual &&\n \tqz_to_tab_space <<-\\EOF >expected &&\n \tmess.. two\n@@ -323,7 +328,7 @@ test_expect_success ICONV 'left alignment formatting with mtrunc. i18n.logOutput\n \ttest_cmp expected actual\n '\n \n-test_expect_success ICONV 'right alignment formatting' '\n+test_expect_success 'right alignment formatting' '\n \tgit log --pretty=\"tformat:%>(40)%s\" >actual &&\n \tqz_to_tab_space <<-EOF >expected &&\n \tZ                            message two\n@@ -345,7 +350,7 @@ test_expect_success ICONV 'right alignment formatting. i18n.logOutputEncoding' '\n \ttest_cmp expected actual\n '\n \n-test_expect_success ICONV 'right alignment formatting at the nth column' '\n+test_expect_success 'right alignment formatting at the nth column' '\n \tgit log --pretty=\"tformat:%h %>|(40)%s\" >actual &&\n \tqz_to_tab_space <<-EOF >expected &&\n \t$head1                      message two\n@@ -356,7 +361,7 @@ test_expect_success ICONV 'right alignment formatting at the nth column' '\n \ttest_cmp expected actual\n '\n \n-test_expect_success ICONV 'right alignment formatting at the nth column' '\n+test_expect_success 'right alignment formatting at the nth column' '\n \tCOLUMNS=50 git log --pretty=\"tformat:%h %>|(-10)%s\" >actual &&\n \tqz_to_tab_space <<-EOF >expected &&\n \t$head1                      message two\n@@ -391,7 +396,7 @@ test_expect_success ICONV 'right alignment formatting at the nth column with --g\n \ttest_cmp expected actual\n '\n \n-test_expect_success ICONV 'right alignment formatting with no padding' '\n+test_expect_success 'right alignment formatting with no padding' '\n \tgit log --pretty=\"tformat:%>(1)%s\" >actual &&\n \tcat <<-EOF >expected &&\n \tmessage two\n@@ -402,7 +407,7 @@ test_expect_success ICONV 'right alignment formatting with no padding' '\n \ttest_cmp expected actual\n '\n \n-test_expect_success ICONV 'right alignment formatting with no padding and with --graph' '\n+test_expect_success 'right alignment formatting with no padding and with --graph' '\n \tgit log --graph --pretty=\"tformat:%>(1)%s\" >actual &&\n \tcat <<-EOF >expected &&\n \t* message two\n@@ -424,7 +429,7 @@ test_expect_success ICONV 'right alignment formatting with no padding. i18n.logO\n \ttest_cmp expected actual\n '\n \n-test_expect_success ICONV 'center alignment formatting' '\n+test_expect_success 'center alignment formatting' '\n \tgit log --pretty=\"tformat:%><(40)%s\" >actual &&\n \tqz_to_tab_space <<-EOF >expected &&\n \tZ             message two              Z\n@@ -445,7 +450,8 @@ test_expect_success ICONV 'center alignment formatting. i18n.logOutputEncoding'\n \tEOF\n \ttest_cmp expected actual\n '\n-test_expect_success ICONV 'center alignment formatting at the nth column' '\n+\n+test_expect_success 'center alignment formatting at the nth column' '\n \tgit log --pretty=\"tformat:%h %><|(40)%s\" >actual &&\n \tqz_to_tab_space <<-EOF >expected &&\n \t$head1           message two          Z\n@@ -456,7 +462,7 @@ test_expect_success ICONV 'center alignment formatting at the nth column' '\n \ttest_cmp expected actual\n '\n \n-test_expect_success ICONV 'center alignment formatting at the nth column' '\n+test_expect_success 'center alignment formatting at the nth column' '\n \tCOLUMNS=70 git log --pretty=\"tformat:%h %><|(-30)%s\" >actual &&\n \tqz_to_tab_space <<-EOF >expected &&\n \t$head1           message two          Z\n@@ -478,7 +484,7 @@ test_expect_success ICONV 'center alignment formatting at the nth column. i18n.l\n \ttest_cmp expected actual\n '\n \n-test_expect_success ICONV 'center alignment formatting with no padding' '\n+test_expect_success 'center alignment formatting with no padding' '\n \tgit log --pretty=\"tformat:%><(1)%s\" >actual &&\n \tcat <<-EOF >expected &&\n \tmessage two\n\n-- \n2.53.0.414.gf7e9f6c205.dirty\n\n"},{"id":"536251","messageId":"20260218-b4-pks-ci-msvc-iconv-fixes-v3-4-08c1ff3ffc9a@pks.im","threadId":"64957","inReplyTo":"20260218-b4-pks-ci-msvc-iconv-fixes-v3-0-08c1ff3ffc9a@pks.im","subject":"[PATCH v3 4/5] t5550: add ICONV prereq to tests that use \"$HTTPD_URL/error\"","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2026-02-18T04:38:41Z","receivedAt":"2026-02-18T04:38:58Z","isPatch":true,"sender":{"key":"ps@pks.im","avatar":"https://avatars.githubusercontent.com/u/4056630?v=4"},"body":"We've got a bunch of tests in t5550 that connect to \"$HTTPD_URL/error\"\nto ensure that error messages are proprely forwarded. This URL executes\nthe \"t/lib-httpd/error.sh\" script, which in turn depends on the iconv(1)\nexecutable to reencode the message.\n\nThis executable may not exist on platforms, which will make the tests\nfail. Guard them with the ICONV prereq to fix such failures.\n\nSigned-off-by: Patrick Steinhardt <ps@pks.im>\n---\n t/t5550-http-fetch-dumb.sh | 20 ++++++++++----------\n 1 file changed, 10 insertions(+), 10 deletions(-)\n\ndiff --git a/t/t5550-http-fetch-dumb.sh b/t/t5550-http-fetch-dumb.sh\nindex ed0ad66fad..55102e702c 100755\n--- a/t/t5550-http-fetch-dumb.sh\n+++ b/t/t5550-http-fetch-dumb.sh\n@@ -339,32 +339,32 @@ test_expect_success 'fetch can handle previously-fetched .idx files' '\n '\n \n test_expect_success 'did not use upload-pack service' '\n-\t! grep \"/git-upload-pack\" \"$HTTPD_ROOT_PATH/access.log\"\n+\t! test_grep \"/git-upload-pack\" \"$HTTPD_ROOT_PATH/access.log\"\n '\n \n-test_expect_success 'git client shows text/plain errors' '\n+test_expect_success ICONV 'git client shows text/plain errors' '\n \ttest_must_fail git clone \"$HTTPD_URL/error/text\" 2>stderr &&\n-\tgrep \"this is the error message\" stderr\n+\ttest_grep \"this is the error message\" stderr\n '\n \n-test_expect_success 'git client does not show html errors' '\n+test_expect_success ICONV 'git client does not show html errors' '\n \ttest_must_fail git clone \"$HTTPD_URL/error/html\" 2>stderr &&\n-\t! grep \"this is the error message\" stderr\n+\t! test_grep \"this is the error message\" stderr\n '\n \n-test_expect_success 'git client shows text/plain with a charset' '\n+test_expect_success ICONV 'git client shows text/plain with a charset' '\n \ttest_must_fail git clone \"$HTTPD_URL/error/charset\" 2>stderr &&\n-\tgrep \"this is the error message\" stderr\n+\ttest_grep \"this is the error message\" stderr\n '\n \n test_expect_success ICONV 'http error messages are reencoded' '\n \ttest_must_fail git clone \"$HTTPD_URL/error/utf16\" 2>stderr &&\n-\tgrep \"this is the error message\" stderr\n+\ttest_grep \"this is the error message\" stderr\n '\n \n test_expect_success ICONV 'reencoding is robust to whitespace oddities' '\n \ttest_must_fail git clone \"$HTTPD_URL/error/odd-spacing\" 2>stderr &&\n-\tgrep \"this is the error message\" stderr\n+\ttest_grep \"this is the error message\" stderr\n '\n \n check_language () {\n@@ -406,7 +406,7 @@ ja;q=0.95, zh;q=0.94, sv;q=0.93, pt;q=0.92, nb;q=0.91, *;q=0.90\" \\\n \n test_expect_success 'git client send an empty Accept-Language' '\n \tGIT_TRACE_CURL=true LANGUAGE= git ls-remote \"$HTTPD_URL/dumb/repo.git\" 2>stderr &&\n-\t! grep \"^=> Send header: Accept-Language:\" stderr\n+\t! test_grep \"^=> Send header: Accept-Language:\" stderr\n '\n \n test_expect_success 'remote-http complains cleanly about malformed urls' '\n\n-- \n2.53.0.414.gf7e9f6c205.dirty\n\n"},{"id":"536252","messageId":"20260218-b4-pks-ci-msvc-iconv-fixes-v3-5-08c1ff3ffc9a@pks.im","threadId":"64957","inReplyTo":"20260218-b4-pks-ci-msvc-iconv-fixes-v3-0-08c1ff3ffc9a@pks.im","subject":"[PATCH v3 5/5] t6006: don't use iconv(1) without ICONV prereq","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2026-02-18T04:38:42Z","receivedAt":"2026-02-18T04:39:02Z","isPatch":true,"sender":{"key":"ps@pks.im","avatar":"https://avatars.githubusercontent.com/u/4056630?v=4"},"body":"Two tests in t6006 depend on the iconv(1) prerequisite to reencode a\ncommit message. This executable may not even exist though in case the\nprereq is not set, which will cause the tests to fail.\n\nFix this by using UTF-8 instead when the prereq is not set.\n\nSigned-off-by: Patrick Steinhardt <ps@pks.im>\n---\n t/t6006-rev-list-format.sh | 29 +++++++++++++++++++++--------\n 1 file changed, 21 insertions(+), 8 deletions(-)\n\ndiff --git a/t/t6006-rev-list-format.sh b/t/t6006-rev-list-format.sh\nindex eb93d68d7d..581984467d 100755\n--- a/t/t6006-rev-list-format.sh\n+++ b/t/t6006-rev-list-format.sh\n@@ -378,15 +378,23 @@ test_expect_success 'rev-list %C(auto,...) respects --color' '\n \ttest_cmp expect actual\n '\n \n-iconv -f utf-8 -t $test_encoding > commit-msg <<EOF\n-Test printing of complex bodies\n+test_expect_success 'setup complex body' '\n+\tmessage=$(cat <<-EOF\n+\tTest printing of complex bodies\n \n-This commit message is much longer than the others,\n-and it will be encoded in $test_encoding. We should therefore\n-include an ISO8859 character: ¡bueno!\n-EOF\n+\tThis commit message is much longer than the others,\n+\tand it will be encoded in $test_encoding. We should therefore\n+\tinclude an ISO8859 character: ¡bueno!\n+\tEOF\n+\t) &&\n+\n+\tif test_have_prereq ICONV\n+\tthen\n+\t\techo \"$message\" | iconv -f utf-8 -t $test_encoding >commit-msg\n+\telse\n+\t\techo \"$message\" >commit-msg\n+\tfi &&\n \n-test_expect_success 'setup complex body' '\n \tgit config i18n.commitencoding $test_encoding &&\n \techo change2 >foo && git commit -a -F commit-msg &&\n \thead3=$(git rev-parse --verify HEAD) &&\n@@ -448,7 +456,12 @@ test_expect_success 'setup expected messages (for test %b)' '\n \tcommit $head2\n \tcommit $head1\n \tEOF\n-\ticonv -f utf-8 -t $test_encoding expected.utf-8 >expected.ISO8859-1\n+\tif test_have_prereq ICONV\n+\tthen\n+\t\ticonv -f utf-8 -t $test_encoding expected.utf-8 >expected.ISO8859-1\n+\telse\n+\t\tcp expected.utf-8 expected.ISO8859-1\n+\tfi\n '\n \n test_format complex-body %b <expected.ISO8859-1\n\n-- \n2.53.0.414.gf7e9f6c205.dirty\n\n"},{"id":"536258","messageId":"20260218064613.172817-1-christian.couder@gmail.com","threadId":"64957","inReplyTo":"20260218-b4-pks-ci-msvc-iconv-fixes-v3-0-08c1ff3ffc9a@pks.im","subject":"Re: [PATCH v3 0/5] Fix tests with missing iconv(1) executable","fromName":"Christian Couder","fromEmail":"christian.couder@gmail.com","sentAt":"2026-02-18T06:46:13Z","receivedAt":"2026-02-18T06:46:24Z","isPatch":true,"sender":{"key":"christian.couder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/208954?v=4"},"body":"(Replying with git send-email as I didn't received your email in my Gmail box.) \n\n> In any case, this patch series causes the MSVC jobs to pass again on\n> GitLab CI.\n>\n> Changes in v3:\n>  - Split out the changes for the ICONV prerequisite into a standalone\n>    commit.\n>  - Link to v2: https://lore.kernel.org/r/20260217-b4-pks-ci-msvc-iconv-fixes-v2-0-25491bc8dbf8@pks.im\n\nThanks. I think it's better with the ICONV prerequisite changes in their own commit.\n\nThe series looks ready to me now.\n"},{"id":"536259","messageId":"aZVlwleQAhTk1BZf@pks.im","threadId":"64957","inReplyTo":"20260218064613.172817-1-christian.couder@gmail.com","subject":"Re: [PATCH v3 0/5] Fix tests with missing iconv(1) executable","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2026-02-18T07:09:54Z","receivedAt":"2026-02-18T07:10:00Z","isPatch":true,"sender":{"key":"ps@pks.im","avatar":"https://avatars.githubusercontent.com/u/4056630?v=4"},"body":"On Wed, Feb 18, 2026 at 07:46:13AM +0100, Christian Couder wrote:\n> (Replying with git send-email as I didn't received your email in my Gmail box.) \n> \n> > In any case, this patch series causes the MSVC jobs to pass again on\n> > GitLab CI.\n> >\n> > Changes in v3:\n> >  - Split out the changes for the ICONV prerequisite into a standalone\n> >    commit.\n> >  - Link to v2: https://lore.kernel.org/r/20260217-b4-pks-ci-msvc-iconv-fixes-v2-0-25491bc8dbf8@pks.im\n> \n> Thanks. I think it's better with the ICONV prerequisite changes in their own commit.\n> \n> The series looks ready to me now.\n\nThanks!\n\nPatrick\n"},{"id":"536306","messageId":"xmqqfr6y7xnn.fsf@gitster.g","threadId":"64957","inReplyTo":"20260218-b4-pks-ci-msvc-iconv-fixes-v3-5-08c1ff3ffc9a@pks.im","subject":"Re: [PATCH v3 5/5] t6006: don't use iconv(1) without ICONV prereq","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2026-02-18T17:46:04Z","receivedAt":"2026-02-18T17:46:08Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Patrick Steinhardt <ps@pks.im> writes:\n\n> Two tests in t6006 depend on the iconv(1) prerequisite to reencode a\n> commit message. This executable may not even exist though in case the\n> prereq is not set, which will cause the tests to fail.\n>\n> Fix this by using UTF-8 instead when the prereq is not set.\n\nThe above makes perfect sense, but would the rest of the test\ninvolving this data need to be adjusted to expect utf-8 instead of\n$test_encoding when iconv is not available?\n\n> -iconv -f utf-8 -t $test_encoding > commit-msg <<EOF\n> -Test printing of complex bodies\n> +test_expect_success 'setup complex body' '\n> +\tmessage=$(cat <<-EOF\n> +\tTest printing of complex bodies\n>  \n> -This commit message is much longer than the others,\n> -and it will be encoded in $test_encoding. We should therefore\n> -include an ISO8859 character: ¡bueno!\n> -EOF\n> +\tThis commit message is much longer than the others,\n> +\tand it will be encoded in $test_encoding. We should therefore\n> +\tinclude an ISO8859 character: ¡bueno!\n> +\tEOF\n> +\t) &&\n\nCreative use of \"cat\" only to strip leading.   Otherwise,\n\n\tmessage=\"Test printing of ...\n\t...\n\tinclude an ISO8859 character: ¡bueno!\"\n\nwould have sufficed ;-).\n\n> +\tif test_have_prereq ICONV\n> +\tthen\n> +\t\techo \"$message\" | iconv -f utf-8 -t $test_encoding >commit-msg\n> +\telse\n> +\t\techo \"$message\" >commit-msg\n> +\tfi &&\n\nSo we have the message in the file encoded in either utf-8 or\nthe target encoding.\n\n> -test_expect_success 'setup complex body' '\n>  \tgit config i18n.commitencoding $test_encoding &&\n\nBut we claim unconditionally $test_encoding is used in the commit\nobject.  This is OK because test_encoding is also set to UTF-8 in the\nIONV challenged environment.  Cute.\n\n> @@ -448,7 +456,12 @@ test_expect_success 'setup expected messages (for test %b)' '\n>  \tcommit $head2\n>  \tcommit $head1\n>  \tEOF\n> -\ticonv -f utf-8 -t $test_encoding expected.utf-8 >expected.ISO8859-1\n> +\tif test_have_prereq ICONV\n> +\tthen\n> +\t\ticonv -f utf-8 -t $test_encoding expected.utf-8 >expected.ISO8859-1\n> +\telse\n> +\t\tcp expected.utf-8 expected.ISO8859-1\n> +\tfi\n>  '\n>  \n>  test_format complex-body %b <expected.ISO8859-1\n\nAnd this is the same idea.  It is confiusing that the data has\nnothing to do with Latin-1 when iconv is not in use, but things will\neven out.  Nice.\n"},{"id":"536448","messageId":"CAPig+cTk_j3qiib1E5McMUPTVY5f36Pq=_8giR_2SKfthY10+g@mail.gmail.com","threadId":"64957","inReplyTo":"20260218-b4-pks-ci-msvc-iconv-fixes-v3-4-08c1ff3ffc9a@pks.im","subject":"Re: [PATCH v3 4/5] t5550: add ICONV prereq to tests that use \"$HTTPD_URL/error\"","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2026-02-19T23:49:14Z","receivedAt":"2026-02-19T23:49:27Z","isPatch":true,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Wed, Feb 18, 2026 at 4:17 AM Patrick Steinhardt <ps@pks.im> wrote:\n> We've got a bunch of tests in t5550 that connect to \"$HTTPD_URL/error\"\n> to ensure that error messages are proprely forwarded. This URL executes\n\ns/proprely/properly/\n\n> the \"t/lib-httpd/error.sh\" script, which in turn depends on the iconv(1)\n> executable to reencode the message.\n>\n> This executable may not exist on platforms, which will make the tests\n> fail. Guard them with the ICONV prereq to fix such failures.\n>\n> Signed-off-by: Patrick Steinhardt <ps@pks.im>\n> ---\n> diff --git a/t/t5550-http-fetch-dumb.sh b/t/t5550-http-fetch-dumb.sh\n> @@ -339,32 +339,32 @@ test_expect_success 'fetch can handle previously-fetched .idx files' '\n>  test_expect_success 'did not use upload-pack service' '\n> -       ! grep \"/git-upload-pack\" \"$HTTPD_ROOT_PATH/access.log\"\n> +       ! test_grep \"/git-upload-pack\" \"$HTTPD_ROOT_PATH/access.log\"\n>  '\n\nYou want to be using `test_grep !` here rather than `! test_grep`, don't you?\n\nSame comment applies to several other tests touched by this patch.\n"},{"id":"536465","messageId":"aZgUj9BBQUcAwHmS@pks.im","threadId":"64957","inReplyTo":"CAPig+cTk_j3qiib1E5McMUPTVY5f36Pq=_8giR_2SKfthY10+g@mail.gmail.com","subject":"Re: [PATCH v3 4/5] t5550: add ICONV prereq to tests that use \"$HTTPD_URL/error\"","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2026-02-20T08:00:15Z","receivedAt":"2026-02-20T08:00:23Z","isPatch":true,"sender":{"key":"ps@pks.im","avatar":"https://avatars.githubusercontent.com/u/4056630?v=4"},"body":"On Thu, Feb 19, 2026 at 06:49:14PM -0500, Eric Sunshine wrote:\n> On Wed, Feb 18, 2026 at 4:17 AM Patrick Steinhardt <ps@pks.im> wrote:\n> > We've got a bunch of tests in t5550 that connect to \"$HTTPD_URL/error\"\n> > to ensure that error messages are proprely forwarded. This URL executes\n> \n> s/proprely/properly/\n> \n> > the \"t/lib-httpd/error.sh\" script, which in turn depends on the iconv(1)\n> > executable to reencode the message.\n> >\n> > This executable may not exist on platforms, which will make the tests\n> > fail. Guard them with the ICONV prereq to fix such failures.\n> >\n> > Signed-off-by: Patrick Steinhardt <ps@pks.im>\n> > ---\n> > diff --git a/t/t5550-http-fetch-dumb.sh b/t/t5550-http-fetch-dumb.sh\n> > @@ -339,32 +339,32 @@ test_expect_success 'fetch can handle previously-fetched .idx files' '\n> >  test_expect_success 'did not use upload-pack service' '\n> > -       ! grep \"/git-upload-pack\" \"$HTTPD_ROOT_PATH/access.log\"\n> > +       ! test_grep \"/git-upload-pack\" \"$HTTPD_ROOT_PATH/access.log\"\n> >  '\n> \n> You want to be using `test_grep !` here rather than `! test_grep`, don't you?\n> \n> Same comment applies to several other tests touched by this patch.\n\nOh, yeah, you're right of course. Will send another version to improve\nthis. Thanks!\n\nPatrick\n"},{"id":"536488","messageId":"20260220-b4-pks-ci-msvc-iconv-fixes-v4-0-e0e6bbcaeb5b@pks.im","threadId":"64957","inReplyTo":"20260209-b4-pks-ci-msvc-iconv-fixes-v1-0-1e3167cd8828@pks.im","subject":"[PATCH v4 0/5] Fix tests with missing iconv(1) executable","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2026-02-20T08:25:58Z","receivedAt":"2026-02-20T08:26:06Z","isPatch":true,"sender":{"key":"ps@pks.im","avatar":"https://avatars.githubusercontent.com/u/4056630?v=4"},"body":"Hi,\n\nI recently noticed that the MSVC-based tests in GitLab CI started to\nfail. The root cause is that the iconv(1) executable cannot be found on\nthis platform anymore. This isn't entirely surprising: we depend on the\nGit for Windows environment to provide necessary shell tools, and that\nenvironment of course is not a fully fledged MSYS2 installation.\n\nIn any case, this patch series fixes those issues by building on top of\nthe ICONV prerequisite. If the prereq isn't found, then we also don't\nassume that the iconv(1) executable exists.\n\nAn alternative strategy would be to introduce a new ICONV_EXECUTABLE\nprereq. But given that Git doesn't perform any kind of reencoding itself\nin case the ICONV support isn't built into it I found it to not be worth\nthe additional hassle.\n\nIn any case, this patch series causes the MSVC jobs to pass again on\nGitLab CI.\n\nChanges in v4:\n  - Use `test_grep !` instead of `! test_grep`.\n  - Another commit message typo fix.\n  - Link to v3: https://lore.kernel.org/r/20260218-b4-pks-ci-msvc-iconv-fixes-v3-0-08c1ff3ffc9a@pks.im\n\nChanges in v3:\n  - Split out the changes for the ICONV prerequisite into a standalone\n    commit.\n  - Link to v2: https://lore.kernel.org/r/20260217-b4-pks-ci-msvc-iconv-fixes-v2-0-25491bc8dbf8@pks.im\n\nChanges in v2:\n  - Extend the ICONV prerequisite to cover the new semantics and add a\n    NEEDSWORK comment.\n  - Mention the upstream issue in Git for Windows.\n  - Link to v1: https://lore.kernel.org/r/20260209-b4-pks-ci-msvc-iconv-fixes-v1-0-1e3167cd8828@pks.im\n\nThanks!\n\nPatrick\n\n---\nPatrick Steinhardt (5):\n      t: don't set ICONV prereq when iconv(1) is missing\n      t40xx: don't use iconv(1) without ICONV prereq\n      t4205: improve handling of ICONV prerequisite\n      t5550: add ICONV prereq to tests that use \"$HTTPD_URL/error\"\n      t6006: don't use iconv(1) without ICONV prereq\n\n t/t4041-diff-submodule-option.sh             |  8 +++--\n t/t4059-diff-submodule-not-initialized.sh    |  8 +++--\n t/t4060-diff-submodule-option-diff-format.sh |  8 +++--\n t/t4205-log-pretty-formats.sh                | 50 ++++++++++++++++------------\n t/t5550-http-fetch-dumb.sh                   | 20 +++++------\n t/t6006-rev-list-format.sh                   | 29 +++++++++++-----\n t/test-lib.sh                                | 12 ++++++-\n 7 files changed, 88 insertions(+), 47 deletions(-)\n\nRange-diff versus v3:\n\n1:  3cfc78f873 = 1:  ac36dae86b t: don't set ICONV prereq when iconv(1) is missing\n2:  768d0c8de1 = 2:  4b461caa9b t40xx: don't use iconv(1) without ICONV prereq\n3:  b552d77cf4 = 3:  ad9278cab4 t4205: improve handling of ICONV prerequisite\n4:  7f35641968 ! 4:  863488c534 t5550: add ICONV prereq to tests that use \"$HTTPD_URL/error\"\n    @@ Commit message\n         t5550: add ICONV prereq to tests that use \"$HTTPD_URL/error\"\n     \n         We've got a bunch of tests in t5550 that connect to \"$HTTPD_URL/error\"\n    -    to ensure that error messages are proprely forwarded. This URL executes\n    +    to ensure that error messages are properly forwarded. This URL executes\n         the \"t/lib-httpd/error.sh\" script, which in turn depends on the iconv(1)\n         executable to reencode the message.\n     \n    @@ t/t5550-http-fetch-dumb.sh: test_expect_success 'fetch can handle previously-fet\n      \n      test_expect_success 'did not use upload-pack service' '\n     -\t! grep \"/git-upload-pack\" \"$HTTPD_ROOT_PATH/access.log\"\n    -+\t! test_grep \"/git-upload-pack\" \"$HTTPD_ROOT_PATH/access.log\"\n    ++\ttest_grep ! \"/git-upload-pack\" \"$HTTPD_ROOT_PATH/access.log\"\n      '\n      \n     -test_expect_success 'git client shows text/plain errors' '\n    @@ t/t5550-http-fetch-dumb.sh: test_expect_success 'fetch can handle previously-fet\n     +test_expect_success ICONV 'git client does not show html errors' '\n      \ttest_must_fail git clone \"$HTTPD_URL/error/html\" 2>stderr &&\n     -\t! grep \"this is the error message\" stderr\n    -+\t! test_grep \"this is the error message\" stderr\n    ++\ttest_grep ! \"this is the error message\" stderr\n      '\n      \n     -test_expect_success 'git client shows text/plain with a charset' '\n    @@ t/t5550-http-fetch-dumb.sh: ja;q=0.95, zh;q=0.94, sv;q=0.93, pt;q=0.92, nb;q=0.9\n      test_expect_success 'git client send an empty Accept-Language' '\n      \tGIT_TRACE_CURL=true LANGUAGE= git ls-remote \"$HTTPD_URL/dumb/repo.git\" 2>stderr &&\n     -\t! grep \"^=> Send header: Accept-Language:\" stderr\n    -+\t! test_grep \"^=> Send header: Accept-Language:\" stderr\n    ++\ttest_grep ! \"^=> Send header: Accept-Language:\" stderr\n      '\n      \n      test_expect_success 'remote-http complains cleanly about malformed urls' '\n5:  c8e69ff135 = 5:  58533d4b58 t6006: don't use iconv(1) without ICONV prereq\n\n---\nbase-commit: 3e0db84c88c57e70ac8be8c196dfa92c5d656fbc\nchange-id: 20260209-b4-pks-ci-msvc-iconv-fixes-13de4801643f\n\n"},{"id":"536489","messageId":"20260220-b4-pks-ci-msvc-iconv-fixes-v4-1-e0e6bbcaeb5b@pks.im","threadId":"64957","inReplyTo":"20260220-b4-pks-ci-msvc-iconv-fixes-v4-0-e0e6bbcaeb5b@pks.im","subject":"[PATCH v4 1/5] t: don't set ICONV prereq when iconv(1) is missing","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2026-02-20T08:25:59Z","receivedAt":"2026-02-20T08:26:08Z","isPatch":true,"sender":{"key":"ps@pks.im","avatar":"https://avatars.githubusercontent.com/u/4056630?v=4"},"body":"We've got a couple of tests that exercise Git with different encodings,\ntypically around commit messages. All of these tests depend on the ICONV\nprerequisite, which is set when Git was built with support for iconv.\n\nMany of those tests also end up using the iconv(1) executable to\nreencode text. But while tests can rely on the fact that Git does have\nsupport for iconv, they cannot assume that the iconv(1) executable\nexists. The consequence is thus that tests will break in case Git is\nbuilt with iconv, but the executable doesn't exist. In fact, some of the\ntests even use the iconv(1) executable unconditionally, regardless of\nwhether or not the ICONV prerequisite is set.\n\nGit for Windows has recently (unintentionally) shipped a change where\nthe iconv(1) binary is not getting installed anymore [1]. And as we use\nGit for Windows directly in MSVC+Meson jobs in GitLab CI this has caused\nsuch tests to break. The missing iconv(1) binary is considered a bug\nthat will be fixed in Git for Windows. But regardless of that it makes\nsense to not assume the binary to always exist so that our test suite\npasses on platforms that don't have iconv at all.\n\nExtend the ICONV prerequisite so that we know to skip tests in case the\niconv(1) binary doesn't exist. We'll adapt tests that are currently\nbroken in subsequent commits.\n\n[1]: https://github.com/git-for-windows/git/issues/6083\n\nSigned-off-by: Patrick Steinhardt <ps@pks.im>\n---\n t/test-lib.sh | 12 +++++++++++-\n 1 file changed, 11 insertions(+), 1 deletion(-)\n\ndiff --git a/t/test-lib.sh b/t/test-lib.sh\nindex 0fb76f7d11..67d15ae079 100644\n--- a/t/test-lib.sh\n+++ b/t/test-lib.sh\n@@ -1720,7 +1720,6 @@ esac\n ( COLUMNS=1 && test $COLUMNS = 1 ) && test_set_prereq COLUMNS_CAN_BE_1\n test -z \"$NO_CURL\" && test_set_prereq LIBCURL\n test -z \"$NO_GITWEB\" && test_set_prereq GITWEB\n-test -z \"$NO_ICONV\" && test_set_prereq ICONV\n test -z \"$NO_PERL\" && test_set_prereq PERL\n test -z \"$NO_PTHREADS\" && test_set_prereq PTHREADS\n test -z \"$NO_PYTHON\" && test_set_prereq PYTHON\n@@ -1731,6 +1730,17 @@ test -n \"$SANITIZE_LEAK\" && test_set_prereq SANITIZE_LEAK\n test -n \"$GIT_VALGRIND_ENABLED\" && test_set_prereq VALGRIND\n test -n \"$PERL_PATH\" && test_set_prereq PERL_TEST_HELPERS\n \n+test_lazy_prereq ICONV '\n+\t# We require Git to be built with iconv support, and we require the\n+\t# iconv binary to exist.\n+\t#\n+\t# NEEDSWORK: We might eventually want to split this up into two\n+\t# prerequisites: one for NO_ICONV, and one for the iconv(1) binary, as\n+\t# some tests only depend on either of these.\n+\ttest -z \"$NO_ICONV\" &&\n+\ticonv -f utf8 -t utf8 </dev/null\n+'\n+\n if test -z \"$GIT_TEST_CHECK_CACHE_TREE\"\n then\n \tGIT_TEST_CHECK_CACHE_TREE=true\n\n-- \n2.53.0.414.gf7e9f6c205.dirty\n\n"},{"id":"536490","messageId":"20260220-b4-pks-ci-msvc-iconv-fixes-v4-2-e0e6bbcaeb5b@pks.im","threadId":"64957","inReplyTo":"20260220-b4-pks-ci-msvc-iconv-fixes-v4-0-e0e6bbcaeb5b@pks.im","subject":"[PATCH v4 2/5] t40xx: don't use iconv(1) without ICONV prereq","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2026-02-20T08:26:00Z","receivedAt":"2026-02-20T08:26:12Z","isPatch":true,"sender":{"key":"ps@pks.im","avatar":"https://avatars.githubusercontent.com/u/4056630?v=4"},"body":"We've got a couple of tests related to diffs in t40xx that use the\niconv(1) executable to convert the encoding of a commit message. All of\nthese tests are prepared to handle a missing ICONV prereq, in which case\nthey will simply use UTF-8 encoding.\n\nBut even if the ICONV prerequisite has failed we try to use the iconv(1)\nexecutable, even though it's not safe to assume that the executable\nexists in that case. And besides that, it's also unnecessary to use\niconv(1) in the first place, as we would only use it to convert from\nUTF-8 to UTF-8, which should be equivalent to a no-op.\n\nFix the issue and skip the call to iconv(1) in case the prerequisite is\nnot set. This makes tests work on systems that don't have iconv at all.\n\nSigned-off-by: Patrick Steinhardt <ps@pks.im>\n---\n t/t4041-diff-submodule-option.sh             | 8 ++++++--\n t/t4059-diff-submodule-not-initialized.sh    | 8 ++++++--\n t/t4060-diff-submodule-option-diff-format.sh | 8 ++++++--\n 3 files changed, 18 insertions(+), 6 deletions(-)\n\ndiff --git a/t/t4041-diff-submodule-option.sh b/t/t4041-diff-submodule-option.sh\nindex 4d4aa1650f..4dd4954260 100755\n--- a/t/t4041-diff-submodule-option.sh\n+++ b/t/t4041-diff-submodule-option.sh\n@@ -37,8 +37,12 @@ add_file () {\n \t\t\ttest_tick &&\n \t\t\t# \"git commit -m\" would break MinGW, as Windows refuse to pass\n \t\t\t# $test_encoding encoded parameter to git.\n-\t\t\techo \"Add $name ($added $name)\" | iconv -f utf-8 -t $test_encoding |\n-\t\t\tgit -c \"i18n.commitEncoding=$test_encoding\" commit -F -\n+\t\t\tmessage=\"Add $name ($added $name)\" &&\n+\t\t\tif test_have_prereq ICONV\n+\t\t\tthen\n+\t\t\t\tmessage=$(echo \"$message\" | iconv -f utf-8 -t $test_encoding)\n+\t\t\tfi &&\n+\t\t\techo \"$message\" | git -c \"i18n.commitEncoding=$test_encoding\" commit -F -\n \t\tdone >/dev/null &&\n \t\tgit rev-parse --short --verify HEAD\n \t)\ndiff --git a/t/t4059-diff-submodule-not-initialized.sh b/t/t4059-diff-submodule-not-initialized.sh\nindex 0fe81056d5..bb902ce94d 100755\n--- a/t/t4059-diff-submodule-not-initialized.sh\n+++ b/t/t4059-diff-submodule-not-initialized.sh\n@@ -35,8 +35,12 @@ add_file () {\n \t\t\ttest_tick &&\n \t\t\t# \"git commit -m\" would break MinGW, as Windows refuse to pass\n \t\t\t# $test_encoding encoded parameter to git.\n-\t\t\techo \"Add $name ($added $name)\" | iconv -f utf-8 -t $test_encoding |\n-\t\t\tgit -c \"i18n.commitEncoding=$test_encoding\" commit -F -\n+\t\t\tmessage=\"Add $name ($added $name)\" &&\n+\t\t\tif test_have_prereq ICONV\n+\t\t\tthen\n+\t\t\t\tmessage=$(echo \"$message\" | iconv -f utf-8 -t $test_encoding)\n+\t\t\tfi &&\n+\t\t\techo \"$message\" | git -c \"i18n.commitEncoding=$test_encoding\" commit -F -\n \t\tdone >/dev/null &&\n \t\tgit rev-parse --short --verify HEAD\n \t)\ndiff --git a/t/t4060-diff-submodule-option-diff-format.sh b/t/t4060-diff-submodule-option-diff-format.sh\nindex dbfeb7470b..d8f9213255 100755\n--- a/t/t4060-diff-submodule-option-diff-format.sh\n+++ b/t/t4060-diff-submodule-option-diff-format.sh\n@@ -35,8 +35,12 @@ add_file () {\n \t\t\ttest_tick &&\n \t\t\t# \"git commit -m\" would break MinGW, as Windows refuse to pass\n \t\t\t# $test_encoding encoded parameter to git.\n-\t\t\techo \"Add $name ($added $name)\" | iconv -f utf-8 -t $test_encoding |\n-\t\t\tgit -c \"i18n.commitEncoding=$test_encoding\" commit -F -\n+\t\t\tmessage=\"Add $name ($added $name)\" &&\n+\t\t\tif test_have_prereq ICONV\n+\t\t\tthen\n+\t\t\t\tmessage=$(echo \"$message\" | iconv -f utf-8 -t $test_encoding)\n+\t\t\tfi &&\n+\t\t\techo \"$message\" | git -c \"i18n.commitEncoding=$test_encoding\" commit -F -\n \t\tdone >/dev/null &&\n \t\tgit rev-parse --short --verify HEAD\n \t)\n\n-- \n2.53.0.414.gf7e9f6c205.dirty\n\n"},{"id":"536491","messageId":"20260220-b4-pks-ci-msvc-iconv-fixes-v4-3-e0e6bbcaeb5b@pks.im","threadId":"64957","inReplyTo":"20260220-b4-pks-ci-msvc-iconv-fixes-v4-0-e0e6bbcaeb5b@pks.im","subject":"[PATCH v4 3/5] t4205: improve handling of ICONV prerequisite","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2026-02-20T08:26:01Z","receivedAt":"2026-02-20T08:26:15Z","isPatch":true,"sender":{"key":"ps@pks.im","avatar":"https://avatars.githubusercontent.com/u/4056630?v=4"},"body":"In t4205 we have a bunch of tests that depend on the iconv prereq. This\nis for most of the part because we format commit messages that have been\nencoded in an encoding different than UTF-8.\n\nThose tests fall into two classes though:\n\n  - One class of tests outputs the data as-is without reencoding.\n\n  - One class of tests outputs the data with \"i18n.logOutputEncoding\" to\n    reencode it.\n\nCuriously enough, both of these classes are marked with the ICONV\nprereq, even though one might expect that the first class wouldn't need\nthe prereq. This is because we unconditionally use ISO-8859-1 encoding\nfor the initial commit message, and thus we depend on converting to\nUTF-8 indeed.\n\nThis creates another problem though: when the iconv(1) executable does\nnot exist the test setup fails, even in the case where the ICONV prereq\nhas not been set.\n\nFix these issues by making the test encoding conditional on ICONV: if\nit's available we use ISO-8859-1, otherwise we use UTF-8. This fixes the\ntest setup on platforms without iconv(1), and it allows us to drop the\nICONV prereq from a bunch of tests.\n\nSigned-off-by: Patrick Steinhardt <ps@pks.im>\n---\n t/t4205-log-pretty-formats.sh | 50 ++++++++++++++++++++++++-------------------\n 1 file changed, 28 insertions(+), 22 deletions(-)\n\ndiff --git a/t/t4205-log-pretty-formats.sh b/t/t4205-log-pretty-formats.sh\nindex 8f2ba98963..3865f6abc7 100755\n--- a/t/t4205-log-pretty-formats.sh\n+++ b/t/t4205-log-pretty-formats.sh\n@@ -9,7 +9,12 @@ test_description='Test pretty formats'\n . ./test-lib.sh\n \n # Tested non-UTF-8 encoding\n-test_encoding=\"ISO8859-1\"\n+if test_have_prereq ICONV\n+then\n+\ttest_encoding=\"ISO8859-1\"\n+else\n+\ttest_encoding=\"UTF-8\"\n+fi\n \n sample_utf8_part=$(printf \"f\\303\\244ng\")\n \n@@ -18,7 +23,7 @@ commit_msg () {\n \t# (translated with Google Translate),\n \t# encoded in UTF-8, used as a commit log message below.\n \tmsg=\"initial. an${sample_utf8_part}lich\\n\"\n-\tif test -n \"$1\"\n+\tif test -n \"$1\" && test \"$1\" != \"UTF-8\"\n \tthen\n \t\tprintf \"$msg\" | iconv -f utf-8 -t \"$1\"\n \telse\n@@ -113,19 +118,19 @@ test_expect_success 'alias loop' '\n \ttest_must_fail git log --pretty=test-foo\n '\n \n-test_expect_success ICONV 'NUL separation' '\n+test_expect_success 'NUL separation' '\n \tprintf \"add bar\\0$(commit_msg)\" >expected &&\n \tgit log -z --pretty=\"format:%s\" >actual &&\n \ttest_cmp expected actual\n '\n \n-test_expect_success ICONV 'NUL termination' '\n+test_expect_success 'NUL termination' '\n \tprintf \"add bar\\0$(commit_msg)\\0\" >expected &&\n \tgit log -z --pretty=\"tformat:%s\" >actual &&\n \ttest_cmp expected actual\n '\n \n-test_expect_success ICONV 'NUL separation with --stat' '\n+test_expect_success 'NUL separation with --stat' '\n \tstat0_part=$(git diff --stat HEAD^ HEAD) &&\n \tstat1_part=$(git diff-tree --no-commit-id --stat --root HEAD^) &&\n \tprintf \"add bar\\n$stat0_part\\n\\0$(commit_msg)\\n$stat1_part\\n\" >expected &&\n@@ -180,7 +185,7 @@ test_expect_success 'setup more commits' '\n \thead4=$(git rev-parse --verify --short HEAD~3)\n '\n \n-test_expect_success ICONV 'left alignment formatting' '\n+test_expect_success 'left alignment formatting' '\n \tgit log --pretty=\"tformat:%<(40)%s\" >actual &&\n \tqz_to_tab_space <<-EOF >expected &&\n \tmessage two                            Z\n@@ -202,7 +207,7 @@ test_expect_success ICONV 'left alignment formatting. i18n.logOutputEncoding' '\n \ttest_cmp expected actual\n '\n \n-test_expect_success ICONV 'left alignment formatting at the nth column' '\n+test_expect_success 'left alignment formatting at the nth column' '\n \tgit log --pretty=\"tformat:%h %<|(40)%s\" >actual &&\n \tqz_to_tab_space <<-EOF >expected &&\n \t$head1 message two                    Z\n@@ -213,7 +218,7 @@ test_expect_success ICONV 'left alignment formatting at the nth column' '\n \ttest_cmp expected actual\n '\n \n-test_expect_success ICONV 'left alignment formatting at the nth column' '\n+test_expect_success 'left alignment formatting at the nth column' '\n \tCOLUMNS=50 git log --pretty=\"tformat:%h %<|(-10)%s\" >actual &&\n \tqz_to_tab_space <<-EOF >expected &&\n \t$head1 message two                    Z\n@@ -235,7 +240,7 @@ test_expect_success ICONV 'left alignment formatting at the nth column. i18n.log\n \ttest_cmp expected actual\n '\n \n-test_expect_success ICONV 'left alignment formatting with no padding' '\n+test_expect_success 'left alignment formatting with no padding' '\n \tgit log --pretty=\"tformat:%<(1)%s\" >actual &&\n \tcat <<-EOF >expected &&\n \tmessage two\n@@ -246,7 +251,7 @@ test_expect_success ICONV 'left alignment formatting with no padding' '\n \ttest_cmp expected actual\n '\n \n-test_expect_success 'left alignment formatting with no padding. i18n.logOutputEncoding' '\n+test_expect_success ICONV 'left alignment formatting with no padding. i18n.logOutputEncoding' '\n \tgit -c i18n.logOutputEncoding=$test_encoding log --pretty=\"tformat:%<(1)%s\" >actual &&\n \tcat <<-EOF | iconv -f utf-8 -t $test_encoding >expected &&\n \tmessage two\n@@ -257,7 +262,7 @@ test_expect_success 'left alignment formatting with no padding. i18n.logOutputEn\n \ttest_cmp expected actual\n '\n \n-test_expect_success ICONV 'left alignment formatting with trunc' '\n+test_expect_success 'left alignment formatting with trunc' '\n \tgit log --pretty=\"tformat:%<(10,trunc)%s\" >actual &&\n \tqz_to_tab_space <<-\\EOF >expected &&\n \tmessage ..\n@@ -279,7 +284,7 @@ test_expect_success ICONV 'left alignment formatting with trunc. i18n.logOutputE\n \ttest_cmp expected actual\n '\n \n-test_expect_success ICONV 'left alignment formatting with ltrunc' '\n+test_expect_success 'left alignment formatting with ltrunc' '\n \tgit log --pretty=\"tformat:%<(10,ltrunc)%s\" >actual &&\n \tqz_to_tab_space <<-EOF >expected &&\n \t..sage two\n@@ -301,7 +306,7 @@ test_expect_success ICONV 'left alignment formatting with ltrunc. i18n.logOutput\n \ttest_cmp expected actual\n '\n \n-test_expect_success ICONV 'left alignment formatting with mtrunc' '\n+test_expect_success 'left alignment formatting with mtrunc' '\n \tgit log --pretty=\"tformat:%<(10,mtrunc)%s\" >actual &&\n \tqz_to_tab_space <<-\\EOF >expected &&\n \tmess.. two\n@@ -323,7 +328,7 @@ test_expect_success ICONV 'left alignment formatting with mtrunc. i18n.logOutput\n \ttest_cmp expected actual\n '\n \n-test_expect_success ICONV 'right alignment formatting' '\n+test_expect_success 'right alignment formatting' '\n \tgit log --pretty=\"tformat:%>(40)%s\" >actual &&\n \tqz_to_tab_space <<-EOF >expected &&\n \tZ                            message two\n@@ -345,7 +350,7 @@ test_expect_success ICONV 'right alignment formatting. i18n.logOutputEncoding' '\n \ttest_cmp expected actual\n '\n \n-test_expect_success ICONV 'right alignment formatting at the nth column' '\n+test_expect_success 'right alignment formatting at the nth column' '\n \tgit log --pretty=\"tformat:%h %>|(40)%s\" >actual &&\n \tqz_to_tab_space <<-EOF >expected &&\n \t$head1                      message two\n@@ -356,7 +361,7 @@ test_expect_success ICONV 'right alignment formatting at the nth column' '\n \ttest_cmp expected actual\n '\n \n-test_expect_success ICONV 'right alignment formatting at the nth column' '\n+test_expect_success 'right alignment formatting at the nth column' '\n \tCOLUMNS=50 git log --pretty=\"tformat:%h %>|(-10)%s\" >actual &&\n \tqz_to_tab_space <<-EOF >expected &&\n \t$head1                      message two\n@@ -391,7 +396,7 @@ test_expect_success ICONV 'right alignment formatting at the nth column with --g\n \ttest_cmp expected actual\n '\n \n-test_expect_success ICONV 'right alignment formatting with no padding' '\n+test_expect_success 'right alignment formatting with no padding' '\n \tgit log --pretty=\"tformat:%>(1)%s\" >actual &&\n \tcat <<-EOF >expected &&\n \tmessage two\n@@ -402,7 +407,7 @@ test_expect_success ICONV 'right alignment formatting with no padding' '\n \ttest_cmp expected actual\n '\n \n-test_expect_success ICONV 'right alignment formatting with no padding and with --graph' '\n+test_expect_success 'right alignment formatting with no padding and with --graph' '\n \tgit log --graph --pretty=\"tformat:%>(1)%s\" >actual &&\n \tcat <<-EOF >expected &&\n \t* message two\n@@ -424,7 +429,7 @@ test_expect_success ICONV 'right alignment formatting with no padding. i18n.logO\n \ttest_cmp expected actual\n '\n \n-test_expect_success ICONV 'center alignment formatting' '\n+test_expect_success 'center alignment formatting' '\n \tgit log --pretty=\"tformat:%><(40)%s\" >actual &&\n \tqz_to_tab_space <<-EOF >expected &&\n \tZ             message two              Z\n@@ -445,7 +450,8 @@ test_expect_success ICONV 'center alignment formatting. i18n.logOutputEncoding'\n \tEOF\n \ttest_cmp expected actual\n '\n-test_expect_success ICONV 'center alignment formatting at the nth column' '\n+\n+test_expect_success 'center alignment formatting at the nth column' '\n \tgit log --pretty=\"tformat:%h %><|(40)%s\" >actual &&\n \tqz_to_tab_space <<-EOF >expected &&\n \t$head1           message two          Z\n@@ -456,7 +462,7 @@ test_expect_success ICONV 'center alignment formatting at the nth column' '\n \ttest_cmp expected actual\n '\n \n-test_expect_success ICONV 'center alignment formatting at the nth column' '\n+test_expect_success 'center alignment formatting at the nth column' '\n \tCOLUMNS=70 git log --pretty=\"tformat:%h %><|(-30)%s\" >actual &&\n \tqz_to_tab_space <<-EOF >expected &&\n \t$head1           message two          Z\n@@ -478,7 +484,7 @@ test_expect_success ICONV 'center alignment formatting at the nth column. i18n.l\n \ttest_cmp expected actual\n '\n \n-test_expect_success ICONV 'center alignment formatting with no padding' '\n+test_expect_success 'center alignment formatting with no padding' '\n \tgit log --pretty=\"tformat:%><(1)%s\" >actual &&\n \tcat <<-EOF >expected &&\n \tmessage two\n\n-- \n2.53.0.414.gf7e9f6c205.dirty\n\n"},{"id":"536492","messageId":"20260220-b4-pks-ci-msvc-iconv-fixes-v4-4-e0e6bbcaeb5b@pks.im","threadId":"64957","inReplyTo":"20260220-b4-pks-ci-msvc-iconv-fixes-v4-0-e0e6bbcaeb5b@pks.im","subject":"[PATCH v4 4/5] t5550: add ICONV prereq to tests that use \"$HTTPD_URL/error\"","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2026-02-20T08:26:02Z","receivedAt":"2026-02-20T08:26:18Z","isPatch":true,"sender":{"key":"ps@pks.im","avatar":"https://avatars.githubusercontent.com/u/4056630?v=4"},"body":"We've got a bunch of tests in t5550 that connect to \"$HTTPD_URL/error\"\nto ensure that error messages are properly forwarded. This URL executes\nthe \"t/lib-httpd/error.sh\" script, which in turn depends on the iconv(1)\nexecutable to reencode the message.\n\nThis executable may not exist on platforms, which will make the tests\nfail. Guard them with the ICONV prereq to fix such failures.\n\nSigned-off-by: Patrick Steinhardt <ps@pks.im>\n---\n t/t5550-http-fetch-dumb.sh | 20 ++++++++++----------\n 1 file changed, 10 insertions(+), 10 deletions(-)\n\ndiff --git a/t/t5550-http-fetch-dumb.sh b/t/t5550-http-fetch-dumb.sh\nindex ed0ad66fad..05c34db780 100755\n--- a/t/t5550-http-fetch-dumb.sh\n+++ b/t/t5550-http-fetch-dumb.sh\n@@ -339,32 +339,32 @@ test_expect_success 'fetch can handle previously-fetched .idx files' '\n '\n \n test_expect_success 'did not use upload-pack service' '\n-\t! grep \"/git-upload-pack\" \"$HTTPD_ROOT_PATH/access.log\"\n+\ttest_grep ! \"/git-upload-pack\" \"$HTTPD_ROOT_PATH/access.log\"\n '\n \n-test_expect_success 'git client shows text/plain errors' '\n+test_expect_success ICONV 'git client shows text/plain errors' '\n \ttest_must_fail git clone \"$HTTPD_URL/error/text\" 2>stderr &&\n-\tgrep \"this is the error message\" stderr\n+\ttest_grep \"this is the error message\" stderr\n '\n \n-test_expect_success 'git client does not show html errors' '\n+test_expect_success ICONV 'git client does not show html errors' '\n \ttest_must_fail git clone \"$HTTPD_URL/error/html\" 2>stderr &&\n-\t! grep \"this is the error message\" stderr\n+\ttest_grep ! \"this is the error message\" stderr\n '\n \n-test_expect_success 'git client shows text/plain with a charset' '\n+test_expect_success ICONV 'git client shows text/plain with a charset' '\n \ttest_must_fail git clone \"$HTTPD_URL/error/charset\" 2>stderr &&\n-\tgrep \"this is the error message\" stderr\n+\ttest_grep \"this is the error message\" stderr\n '\n \n test_expect_success ICONV 'http error messages are reencoded' '\n \ttest_must_fail git clone \"$HTTPD_URL/error/utf16\" 2>stderr &&\n-\tgrep \"this is the error message\" stderr\n+\ttest_grep \"this is the error message\" stderr\n '\n \n test_expect_success ICONV 'reencoding is robust to whitespace oddities' '\n \ttest_must_fail git clone \"$HTTPD_URL/error/odd-spacing\" 2>stderr &&\n-\tgrep \"this is the error message\" stderr\n+\ttest_grep \"this is the error message\" stderr\n '\n \n check_language () {\n@@ -406,7 +406,7 @@ ja;q=0.95, zh;q=0.94, sv;q=0.93, pt;q=0.92, nb;q=0.91, *;q=0.90\" \\\n \n test_expect_success 'git client send an empty Accept-Language' '\n \tGIT_TRACE_CURL=true LANGUAGE= git ls-remote \"$HTTPD_URL/dumb/repo.git\" 2>stderr &&\n-\t! grep \"^=> Send header: Accept-Language:\" stderr\n+\ttest_grep ! \"^=> Send header: Accept-Language:\" stderr\n '\n \n test_expect_success 'remote-http complains cleanly about malformed urls' '\n\n-- \n2.53.0.414.gf7e9f6c205.dirty\n\n"},{"id":"536493","messageId":"20260220-b4-pks-ci-msvc-iconv-fixes-v4-5-e0e6bbcaeb5b@pks.im","threadId":"64957","inReplyTo":"20260220-b4-pks-ci-msvc-iconv-fixes-v4-0-e0e6bbcaeb5b@pks.im","subject":"[PATCH v4 5/5] t6006: don't use iconv(1) without ICONV prereq","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2026-02-20T08:26:03Z","receivedAt":"2026-02-20T08:26:21Z","isPatch":true,"sender":{"key":"ps@pks.im","avatar":"https://avatars.githubusercontent.com/u/4056630?v=4"},"body":"Two tests in t6006 depend on the iconv(1) prerequisite to reencode a\ncommit message. This executable may not even exist though in case the\nprereq is not set, which will cause the tests to fail.\n\nFix this by using UTF-8 instead when the prereq is not set.\n\nSigned-off-by: Patrick Steinhardt <ps@pks.im>\n---\n t/t6006-rev-list-format.sh | 29 +++++++++++++++++++++--------\n 1 file changed, 21 insertions(+), 8 deletions(-)\n\ndiff --git a/t/t6006-rev-list-format.sh b/t/t6006-rev-list-format.sh\nindex eb93d68d7d..581984467d 100755\n--- a/t/t6006-rev-list-format.sh\n+++ b/t/t6006-rev-list-format.sh\n@@ -378,15 +378,23 @@ test_expect_success 'rev-list %C(auto,...) respects --color' '\n \ttest_cmp expect actual\n '\n \n-iconv -f utf-8 -t $test_encoding > commit-msg <<EOF\n-Test printing of complex bodies\n+test_expect_success 'setup complex body' '\n+\tmessage=$(cat <<-EOF\n+\tTest printing of complex bodies\n \n-This commit message is much longer than the others,\n-and it will be encoded in $test_encoding. We should therefore\n-include an ISO8859 character: ¡bueno!\n-EOF\n+\tThis commit message is much longer than the others,\n+\tand it will be encoded in $test_encoding. We should therefore\n+\tinclude an ISO8859 character: ¡bueno!\n+\tEOF\n+\t) &&\n+\n+\tif test_have_prereq ICONV\n+\tthen\n+\t\techo \"$message\" | iconv -f utf-8 -t $test_encoding >commit-msg\n+\telse\n+\t\techo \"$message\" >commit-msg\n+\tfi &&\n \n-test_expect_success 'setup complex body' '\n \tgit config i18n.commitencoding $test_encoding &&\n \techo change2 >foo && git commit -a -F commit-msg &&\n \thead3=$(git rev-parse --verify HEAD) &&\n@@ -448,7 +456,12 @@ test_expect_success 'setup expected messages (for test %b)' '\n \tcommit $head2\n \tcommit $head1\n \tEOF\n-\ticonv -f utf-8 -t $test_encoding expected.utf-8 >expected.ISO8859-1\n+\tif test_have_prereq ICONV\n+\tthen\n+\t\ticonv -f utf-8 -t $test_encoding expected.utf-8 >expected.ISO8859-1\n+\telse\n+\t\tcp expected.utf-8 expected.ISO8859-1\n+\tfi\n '\n \n test_format complex-body %b <expected.ISO8859-1\n\n-- \n2.53.0.414.gf7e9f6c205.dirty\n\n"},{"id":"536527","messageId":"xmqqa4x31kdr.fsf@gitster.g","threadId":"64957","inReplyTo":"20260220-b4-pks-ci-msvc-iconv-fixes-v4-0-e0e6bbcaeb5b@pks.im","subject":"Re: [PATCH v4 0/5] Fix tests with missing iconv(1) executable","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2026-02-20T15:53:52Z","receivedAt":"2026-02-20T15:53:55Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Patrick Steinhardt <ps@pks.im> writes:\n\n> Changes in v4:\n>   - Use `test_grep !` instead of `! test_grep`.\n\nI missed these when I looked at the previous round.  Thanks for\ncatching and fixing them.\n"}]}