{"thread":{"id":"62330","subject":"[PATCH 00/10] Platform compatibility fixes","startedAt":"2024-10-14T12:21:15Z","lastAt":"2024-10-28T17:48:13Z","messageCount":58,"participants":["Patrick Steinhardt","Taylor Blau","Eric Sunshine","James Liu","brian m. carlson","Josh Steadmon"],"isPatch":true,"patchVersion":1,"patchTotal":10},"messages":[{"id":"504987","messageId":"cover.1728906490.git.ps@pks.im","threadId":"62330","inReplyTo":null,"subject":"[PATCH 00/10] Platform compatibility fixes","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2024-10-14T12:21:10Z","receivedAt":"2024-10-14T12:21:15Z","isPatch":true,"sender":{"key":"ps@pks.im","avatar":"https://avatars.githubusercontent.com/u/4056630?v=4"},"body":"Hi,\n\nthis patch series includes platform compatibility fixes that I have\nfound while working on the Meson build system. These patches have been\nsplit out of the original patch series at [1] such that it can land\nindependent of the changes in there.\n\nI'll reroll the Meson patch series eventually and build on top of this\npatch series here and a second, independent patch series that updates\nclar [2].\n\nThanks!\n\nPatrick\n\n[1]: https://lore.kernel.org/git/cover.1727881164.git.ps@pks.im/\n[2]: https://lore.kernel.org/git/cover.1728903464.git.ps@pks.im/\n\nPatrick Steinhardt (10):\n  t/test-lib: fix quoting of TEST_RESULTS_SAN_FILE\n  t/test-lib: wire up NO_ICONV prerequisite\n  t/lib-gitweb: test against the build version of gitweb\n  t/lib-gpg: fix setup of GNUPGHOME in MinGW\n  t1401: make invocation of tar(1) work with Win32-provided one\n  t3404: work around platform-specific behaviour on macOS 10.15\n  t5500, t5601: skip tests which exercise paths with '[::1]' on Cygwin\n  t7300: work around platform-specific behaviour with long paths on\n    MinGW\n  builtin/credential-cache: fix missing parameter for stub function\n  http: fix build error on FreeBSD\n\n Makefile                                     |   1 +\n builtin/credential-cache.c                   |   3 +-\n contrib/buildsystems/CMakeLists.txt          |   6 ++\n http.c                                       |  10 +-\n t/lib-gitweb.sh                              |   2 +-\n t/lib-gpg.sh                                 |   2 +-\n t/t0028-working-tree-encoding.sh             |   6 ++\n t/t1401-symbolic-ref.sh                      |   2 +-\n t/t2082-parallel-checkout-attributes.sh      |   2 +-\n t/t3404-rebase-interactive.sh                |  26 +++--\n t/t3434-rebase-i18n.sh                       |   6 ++\n t/t3900-i18n-commit.sh                       |   6 ++\n t/t3901-i18n-patch.sh                        |   6 ++\n t/t4041-diff-submodule-option.sh             |  16 ++-\n t/t4059-diff-submodule-not-initialized.sh    |  16 ++-\n t/t4060-diff-submodule-option-diff-format.sh |  17 ++--\n t/t4201-shortlog.sh                          |   8 +-\n t/t4205-log-pretty-formats.sh                | 102 +++++++++++--------\n t/t4210-log-i18n.sh                          |   6 ++\n t/t4254-am-corrupt.sh                        |   6 ++\n t/t5100-mailinfo.sh                          |  14 ++-\n t/t5500-fetch-pack.sh                        |  14 ++-\n t/t5550-http-fetch-dumb.sh                   |   4 +-\n t/t5601-clone.sh                             |  11 +-\n t/t6006-rev-list-format.sh                   |  54 ++++++----\n t/t7102-reset.sh                             |  40 +++++---\n t/t7300-clean.sh                             |   2 +-\n t/t8005-blame-i18n.sh                        |   6 ++\n t/t9300-fast-import.sh                       |   2 +-\n t/t9350-fast-export.sh                       |  10 +-\n t/test-lib.sh                                |   3 +-\n 31 files changed, 273 insertions(+), 136 deletions(-)\n\n-- \n2.47.0.dirty\n\n"},{"id":"504988","messageId":"601670912eeb80cc599c0e7af4ea87c370ae831d.1728906490.git.ps@pks.im","threadId":"62330","inReplyTo":"cover.1728906490.git.ps@pks.im","subject":"[PATCH 01/10] t/test-lib: fix quoting of TEST_RESULTS_SAN_FILE","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2024-10-14T12:21:12Z","receivedAt":"2024-10-14T12:21:16Z","isPatch":true,"sender":{"key":"ps@pks.im","avatar":"https://avatars.githubusercontent.com/u/4056630?v=4"},"body":"When assembling our LSAN_OPTIONS that configure the leak sanitizer we\nend up prepending the string with various different colon-separated\noptions via calls to `prepend_var`. One of the settings we add is the\npath where the sanitizer should store logs, which can be an arbitrary\nfilesystem path.\n\nNaturally, filesystem paths may contain whitespace characters. And while\nit does seem as if we were quoting the value, we use escaped quotes and\nconsequently split up the value if it does contain spaces. This leads to\nthe following error in t0000 when having a value with whitespaces:\n\n    .../t/test-lib.sh: eval: line 64: unexpected EOF while looking for matching `\"'\n    ++ return 1\n    error: last command exited with $?=1\n    not ok 5 - subtest: 3 passing tests\n\nThe error itself is a bit puzzling at first. The basic problem is that\nthe code sees the leading escaped quote during eval, but because we\ntruncate everything after the space character it doesn't see the\ntrailing escaped quote and thus fails to parse the string.\n\nProperly quote the value to fix the issue while using single-quotes to\nquote the inner value passed to eval. The issue can be reproduced by\nt0000 with such a path that contains spaces.\n\nSigned-off-by: Patrick Steinhardt <ps@pks.im>\n---\n t/test-lib.sh | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/t/test-lib.sh b/t/test-lib.sh\nindex b1a8ee5c002..241198ba95f 100644\n--- a/t/test-lib.sh\n+++ b/t/test-lib.sh\n@@ -1572,7 +1572,7 @@ then\n \n \tprepend_var LSAN_OPTIONS : dedup_token_length=9999\n \tprepend_var LSAN_OPTIONS : log_exe_name=1\n-\tprepend_var LSAN_OPTIONS : log_path=\\\"$TEST_RESULTS_SAN_FILE\\\"\n+\tprepend_var LSAN_OPTIONS : log_path=\"'$TEST_RESULTS_SAN_FILE'\"\n \texport LSAN_OPTIONS\n \n elif test \"$GIT_TEST_PASSING_SANITIZE_LEAK\" = \"check\" ||\n-- \n2.47.0.dirty\n\n"},{"id":"504989","messageId":"f1d74c46aa29e2c9dfe5d7a6bd758da9c29571f3.1728906490.git.ps@pks.im","threadId":"62330","inReplyTo":"cover.1728906490.git.ps@pks.im","subject":"[PATCH 02/10] t/test-lib: wire up NO_ICONV prerequisite","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2024-10-14T12:21:15Z","receivedAt":"2024-10-14T12:21:19Z","isPatch":true,"sender":{"key":"ps@pks.im","avatar":"https://avatars.githubusercontent.com/u/4056630?v=4"},"body":"The iconv library is used by Git to reencode files, commit messages and\nother things. As such it is a rather integral part, but given that many\nplatforms nowadays use UTF-8 everywhere you can live without support for\nreencoding in many situations. It is thus optional to build Git with\niconv, and some of our platforms wired up in \"config.mak.uname\" disable\nit. But while we support building without it, running our test suite\nwith \"NO_ICONV=Yes\" causes many test failures.\n\nWire up a new test prerequisite ICONV that gets populated via our\nGIT-BUILD-OPTIONS. Annotate failing tests accordingly.\n\nNote that this commit does not do a deep dive into every single test to\nassess whether the failure is expected or not. Most of the tests do\nsmell like the expected kind of failure though.\n\nFurther note that there are several \"!MINGW\" conditions in t4201, and\nall of these fail due to iconv-related errors. This is quite likely a\nleftover from times before dce7d29551 (msvc: support building Git using\nMS Visual C++, 2019-06-25), which switched Windows-based builds over\nfrom \"NO_ICONV=YesPlease\" to \"NEEDS_LIBICONV=YesPlease\". Consequently,\nadapt those tests to also use the new ICONV prerequisite.\n\nSigned-off-by: Patrick Steinhardt <ps@pks.im>\n---\n Makefile                                     |   1 +\n contrib/buildsystems/CMakeLists.txt          |   6 ++\n t/t0028-working-tree-encoding.sh             |   6 ++\n t/t2082-parallel-checkout-attributes.sh      |   2 +-\n t/t3434-rebase-i18n.sh                       |   6 ++\n t/t3900-i18n-commit.sh                       |   6 ++\n t/t3901-i18n-patch.sh                        |   6 ++\n t/t4041-diff-submodule-option.sh             |  16 ++-\n t/t4059-diff-submodule-not-initialized.sh    |  16 ++-\n t/t4060-diff-submodule-option-diff-format.sh |  17 ++--\n t/t4201-shortlog.sh                          |   8 +-\n t/t4205-log-pretty-formats.sh                | 102 +++++++++++--------\n t/t4210-log-i18n.sh                          |   6 ++\n t/t4254-am-corrupt.sh                        |   6 ++\n t/t5100-mailinfo.sh                          |  14 ++-\n t/t5550-http-fetch-dumb.sh                   |   4 +-\n t/t6006-rev-list-format.sh                   |  54 ++++++----\n t/t7102-reset.sh                             |  40 +++++---\n t/t8005-blame-i18n.sh                        |   6 ++\n t/t9300-fast-import.sh                       |   2 +-\n t/t9350-fast-export.sh                       |  10 +-\n t/test-lib.sh                                |   1 +\n 22 files changed, 229 insertions(+), 106 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex feeed6f9321..5db10347341 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -3171,6 +3171,7 @@ GIT-BUILD-OPTIONS: FORCE\n \t@echo PYTHON_PATH=\\''$(subst ','\\'',$(PYTHON_PATH_SQ))'\\' >>$@+\n \t@echo TAR=\\''$(subst ','\\'',$(subst ','\\'',$(TAR)))'\\' >>$@+\n \t@echo NO_CURL=\\''$(subst ','\\'',$(subst ','\\'',$(NO_CURL)))'\\' >>$@+\n+\t@echo NO_ICONV=\\''$(subst ','\\'',$(subst ','\\'',$(NO_ICONV)))'\\' >>$@+\n \t@echo NO_EXPAT=\\''$(subst ','\\'',$(subst ','\\'',$(NO_EXPAT)))'\\' >>$@+\n \t@echo USE_LIBPCRE2=\\''$(subst ','\\'',$(subst ','\\'',$(USE_LIBPCRE2)))'\\' >>$@+\n \t@echo NO_PERL=\\''$(subst ','\\'',$(subst ','\\'',$(NO_PERL)))'\\' >>$@+\ndiff --git a/contrib/buildsystems/CMakeLists.txt b/contrib/buildsystems/CMakeLists.txt\nindex 62af7b33d2f..1384c0eb6d3 100644\n--- a/contrib/buildsystems/CMakeLists.txt\n+++ b/contrib/buildsystems/CMakeLists.txt\n@@ -1109,6 +1109,7 @@ set(DIFF diff)\n set(PYTHON_PATH /usr/bin/python)\n set(TAR tar)\n set(NO_CURL )\n+set(NO_ICONV )\n set(NO_EXPAT )\n set(USE_LIBPCRE2 )\n set(NO_PERL )\n@@ -1122,6 +1123,10 @@ if(NOT CURL_FOUND)\n \tset(NO_CURL 1)\n endif()\n \n+if(NOT Iconv_FOUND)\n+\tSET(NO_ICONV 1)\n+endif()\n+\n if(NOT EXPAT_FOUND)\n \tset(NO_EXPAT 1)\n endif()\n@@ -1145,6 +1150,7 @@ file(APPEND ${CMAKE_BINARY_DIR}/GIT-BUILD-OPTIONS \"DIFF='${DIFF}'\\n\")\n file(APPEND ${CMAKE_BINARY_DIR}/GIT-BUILD-OPTIONS \"PYTHON_PATH='${PYTHON_PATH}'\\n\")\n file(APPEND ${CMAKE_BINARY_DIR}/GIT-BUILD-OPTIONS \"TAR='${TAR}'\\n\")\n file(APPEND ${CMAKE_BINARY_DIR}/GIT-BUILD-OPTIONS \"NO_CURL='${NO_CURL}'\\n\")\n+file(APPEND ${CMAKE_BINARY_DIR}/GIT-BUILD-OPTIONS \"NO_ICONV='${NO_ICONV}'\\n\")\n file(APPEND ${CMAKE_BINARY_DIR}/GIT-BUILD-OPTIONS \"NO_EXPAT='${NO_EXPAT}'\\n\")\n file(APPEND ${CMAKE_BINARY_DIR}/GIT-BUILD-OPTIONS \"NO_PERL='${NO_PERL}'\\n\")\n file(APPEND ${CMAKE_BINARY_DIR}/GIT-BUILD-OPTIONS \"NO_PTHREADS='${NO_PTHREADS}'\\n\")\ndiff --git a/t/t0028-working-tree-encoding.sh b/t/t0028-working-tree-encoding.sh\nindex ad151a34670..510da4ca12d 100755\n--- a/t/t0028-working-tree-encoding.sh\n+++ b/t/t0028-working-tree-encoding.sh\n@@ -12,6 +12,12 @@ TEST_CREATE_REPO_NO_TEMPLATE=1\n \n GIT_TRACE_WORKING_TREE_ENCODING=1 && export GIT_TRACE_WORKING_TREE_ENCODING\n \n+if ! test_have_prereq ICONV\n+then\n+\tskip_all='skipping working tree encoding tests; iconv not available'\n+\ttest_done\n+fi\n+\n test_expect_success 'setup test files' '\n \tgit config core.eol lf &&\n \ndiff --git a/t/t2082-parallel-checkout-attributes.sh b/t/t2082-parallel-checkout-attributes.sh\nindex aec55496eb1..a040aa54cee 100755\n--- a/t/t2082-parallel-checkout-attributes.sh\n+++ b/t/t2082-parallel-checkout-attributes.sh\n@@ -34,7 +34,7 @@ test_expect_success 'parallel-checkout with ident' '\n \t)\n '\n \n-test_expect_success 'parallel-checkout with re-encoding' '\n+test_expect_success ICONV 'parallel-checkout with re-encoding' '\n \tset_checkout_config 2 0 &&\n \tgit init encoding &&\n \t(\ndiff --git a/t/t3434-rebase-i18n.sh b/t/t3434-rebase-i18n.sh\nindex 26a48d6b103..97fc9a23f21 100755\n--- a/t/t3434-rebase-i18n.sh\n+++ b/t/t3434-rebase-i18n.sh\n@@ -20,6 +20,12 @@ export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME\n TEST_PASSES_SANITIZE_LEAK=true\n . ./test-lib.sh\n \n+if ! test_have_prereq ICONV\n+then\n+\tskip_all='skipping rebase i18n tests; iconv not available'\n+\ttest_done\n+fi\n+\n compare_msg () {\n \ticonv -f \"$2\" -t \"$3\" \"$TEST_DIRECTORY/t3434/$1\" >expect &&\n \tgit cat-file commit HEAD >raw &&\ndiff --git a/t/t3900-i18n-commit.sh b/t/t3900-i18n-commit.sh\nindex db7b403bc15..9d4b5ab1f95 100755\n--- a/t/t3900-i18n-commit.sh\n+++ b/t/t3900-i18n-commit.sh\n@@ -8,6 +8,12 @@ test_description='commit and log output encodings'\n TEST_PASSES_SANITIZE_LEAK=true\n . ./test-lib.sh\n \n+if ! test_have_prereq ICONV\n+then\n+\tskip_all='skipping commit i18n tests; iconv not available'\n+\ttest_done\n+fi\n+\n compare_with () {\n \tgit show -s $1 | sed -e '1,/^$/d' -e 's/^    //' >current &&\n \tcase \"$3\" in\ndiff --git a/t/t3901-i18n-patch.sh b/t/t3901-i18n-patch.sh\nindex 5f0b9afc3fa..e0659c92935 100755\n--- a/t/t3901-i18n-patch.sh\n+++ b/t/t3901-i18n-patch.sh\n@@ -11,6 +11,12 @@ export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME\n TEST_PASSES_SANITIZE_LEAK=true\n . ./test-lib.sh\n \n+if ! test_have_prereq ICONV\n+then\n+\tskip_all='skipping patch i18n tests; iconv not available'\n+\ttest_done\n+fi\n+\n check_encoding () {\n \t# Make sure characters are not corrupted\n \tcnt=\"$1\" header=\"$2\" i=1 j=0\ndiff --git a/t/t4041-diff-submodule-option.sh b/t/t4041-diff-submodule-option.sh\nindex 8fc40e75eb3..aa149e0085e 100755\n--- a/t/t4041-diff-submodule-option.sh\n+++ b/t/t4041-diff-submodule-option.sh\n@@ -15,12 +15,18 @@ export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME\n TEST_PASSES_SANITIZE_LEAK=true\n . ./test-lib.sh\n \n-# Tested non-UTF-8 encoding\n-test_encoding=\"ISO8859-1\"\n+# Test non-UTF-8 encoding in case iconv is available.\n+if test_have_prereq ICONV\n+then\n+\ttest_encoding=\"ISO8859-1\"\n+\t# String \"added\" in German (translated with Google Translate), encoded in UTF-8,\n+\t# used in sample commit log messages in add_file() function below.\n+\tadded=$(printf \"hinzugef\\303\\274gt\")\n+else\n+\ttest_encoding=\"UTF-8\"\n+\tadded=\"added\"\n+fi\n \n-# String \"added\" in German (translated with Google Translate), encoded in UTF-8,\n-# used in sample commit log messages in add_file() function below.\n-added=$(printf \"hinzugef\\303\\274gt\")\n add_file () {\n \t(\n \t\tcd \"$1\" &&\ndiff --git a/t/t4059-diff-submodule-not-initialized.sh b/t/t4059-diff-submodule-not-initialized.sh\nindex 668f5263038..28fd3cdb154 100755\n--- a/t/t4059-diff-submodule-not-initialized.sh\n+++ b/t/t4059-diff-submodule-not-initialized.sh\n@@ -12,12 +12,18 @@ initialized previously but the checkout has since been removed.\n TEST_PASSES_SANITIZE_LEAK=true\n . ./test-lib.sh\n \n-# Tested non-UTF-8 encoding\n-test_encoding=\"ISO8859-1\"\n \n-# String \"added\" in German (translated with Google Translate), encoded in UTF-8,\n-# used in sample commit log messages in add_file() function below.\n-added=$(printf \"hinzugef\\303\\274gt\")\n+# Test non-UTF-8 encoding in case iconv is available.\n+if test_have_prereq ICONV\n+then\n+\ttest_encoding=\"ISO8859-1\"\n+\t# String \"added\" in German (translated with Google Translate), encoded in UTF-8,\n+\t# used in sample commit log messages in add_file() function below.\n+\tadded=$(printf \"hinzugef\\303\\274gt\")\n+else\n+\ttest_encoding=\"UTF-8\"\n+\tadded=\"added\"\n+fi\n \n add_file () {\n \t(\ndiff --git a/t/t4060-diff-submodule-option-diff-format.sh b/t/t4060-diff-submodule-option-diff-format.sh\nindex 8ce67442d96..918334fa4c8 100755\n--- a/t/t4060-diff-submodule-option-diff-format.sh\n+++ b/t/t4060-diff-submodule-option-diff-format.sh\n@@ -13,12 +13,17 @@ This test tries to verify the sanity of --submodule=diff option of git diff.\n TEST_PASSES_SANITIZE_LEAK=true\n . ./test-lib.sh\n \n-# Tested non-UTF-8 encoding\n-test_encoding=\"ISO8859-1\"\n-\n-# String \"added\" in German (translated with Google Translate), encoded in UTF-8,\n-# used in sample commit log messages in add_file() function below.\n-added=$(printf \"hinzugef\\303\\274gt\")\n+# Test non-UTF-8 encoding in case iconv is available.\n+if test_have_prereq ICONV\n+then\n+\ttest_encoding=\"ISO8859-1\"\n+\t# String \"added\" in German (translated with Google Translate), encoded in UTF-8,\n+\t# used in sample commit log messages in add_file() function below.\n+\tadded=$(printf \"hinzugef\\303\\274gt\")\n+else\n+\ttest_encoding=\"UTF-8\"\n+\tadded=\"added\"\n+fi\n \n add_file () {\n \t(\ndiff --git a/t/t4201-shortlog.sh b/t/t4201-shortlog.sh\nindex c20c8857244..680e707ba1e 100755\n--- a/t/t4201-shortlog.sh\n+++ b/t/t4201-shortlog.sh\n@@ -105,7 +105,7 @@ test_expect_success 'output from user-defined format is re-wrapped' '\n \ttest_cmp expect log.predictable\n '\n \n-test_expect_success !MINGW 'shortlog wrapping' '\n+test_expect_success ICONV 'shortlog wrapping' '\n \tcat >expect <<\\EOF &&\n A U Thor (5):\n       Test\n@@ -126,13 +126,13 @@ EOF\n \ttest_cmp expect out\n '\n \n-test_expect_success !MINGW 'shortlog from non-git directory' '\n+test_expect_success ICONV 'shortlog from non-git directory' '\n \tgit log --no-expand-tabs HEAD >log &&\n \tGIT_DIR=non-existing git shortlog -w <log >out &&\n \ttest_cmp expect out\n '\n \n-test_expect_success !MINGW 'shortlog can read --format=raw output' '\n+test_expect_success ICONV 'shortlog can read --format=raw output' '\n \tgit log --format=raw HEAD >log &&\n \tGIT_DIR=non-existing git shortlog -w <log >out &&\n \ttest_cmp expect out\n@@ -182,7 +182,7 @@ $DSCHO (2):\n \n EOF\n \n-test_expect_success !MINGW 'shortlog encoding' '\n+test_expect_success ICONV 'shortlog encoding' '\n \tgit reset --hard \"$commit\" &&\n \tgit config --unset i18n.commitencoding &&\n \techo 2 > a1 &&\ndiff --git a/t/t4205-log-pretty-formats.sh b/t/t4205-log-pretty-formats.sh\nindex eb63ce011fa..dbbd6125510 100755\n--- a/t/t4205-log-pretty-formats.sh\n+++ b/t/t4205-log-pretty-formats.sh\n@@ -114,19 +114,19 @@ test_expect_success 'alias loop' '\n \ttest_must_fail git log --pretty=test-foo\n '\n \n-test_expect_success 'NUL separation' '\n+test_expect_success ICONV '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 'NUL termination' '\n+test_expect_success ICONV '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 'NUL separation with --stat' '\n+test_expect_success ICONV '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@@ -181,7 +181,7 @@ test_expect_success 'setup more commits' '\n \thead4=$(git rev-parse --verify --short HEAD~3)\n '\n \n-test_expect_success 'left alignment formatting' '\n+test_expect_success ICONV 'left alignment formatting' '\n \tgit log --pretty=\"tformat:%<(40)%s\" >actual &&\n \tqz_to_tab_space <<-EOF >expected &&\n \tmessage two                            Z\n@@ -192,7 +192,7 @@ test_expect_success 'left alignment formatting' '\n \ttest_cmp expected actual\n '\n \n-test_expect_success 'left alignment formatting. i18n.logOutputEncoding' '\n+test_expect_success ICONV 'left alignment formatting. i18n.logOutputEncoding' '\n \tgit -c i18n.logOutputEncoding=$test_encoding log --pretty=\"tformat:%<(40)%s\" >actual &&\n \tqz_to_tab_space <<-EOF | iconv -f utf-8 -t $test_encoding >expected &&\n \tmessage two                            Z\n@@ -203,7 +203,7 @@ test_expect_success 'left alignment formatting. i18n.logOutputEncoding' '\n \ttest_cmp expected actual\n '\n \n-test_expect_success 'left alignment formatting at the nth column' '\n+test_expect_success ICONV '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@@ -214,7 +214,7 @@ test_expect_success 'left alignment formatting at the nth column' '\n \ttest_cmp expected actual\n '\n \n-test_expect_success 'left alignment formatting at the nth column' '\n+test_expect_success ICONV '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@@ -225,7 +225,7 @@ test_expect_success 'left alignment formatting at the nth column' '\n \ttest_cmp expected actual\n '\n \n-test_expect_success 'left alignment formatting at the nth column. i18n.logOutputEncoding' '\n+test_expect_success ICONV 'left alignment formatting at the nth column. i18n.logOutputEncoding' '\n \tgit -c i18n.logOutputEncoding=$test_encoding log --pretty=\"tformat:%h %<|(40)%s\" >actual &&\n \tqz_to_tab_space <<-EOF | iconv -f utf-8 -t $test_encoding >expected &&\n \t$head1 message two                    Z\n@@ -236,7 +236,7 @@ test_expect_success 'left alignment formatting at the nth column. i18n.logOutput\n \ttest_cmp expected actual\n '\n \n-test_expect_success 'left alignment formatting with no padding' '\n+test_expect_success ICONV 'left alignment formatting with no padding' '\n \tgit log --pretty=\"tformat:%<(1)%s\" >actual &&\n \tcat <<-EOF >expected &&\n \tmessage two\n@@ -258,7 +258,7 @@ test_expect_success 'left alignment formatting with no padding. i18n.logOutputEn\n \ttest_cmp expected actual\n '\n \n-test_expect_success 'left alignment formatting with trunc' '\n+test_expect_success ICONV 'left alignment formatting with trunc' '\n \tgit log --pretty=\"tformat:%<(10,trunc)%s\" >actual &&\n \tqz_to_tab_space <<-\\EOF >expected &&\n \tmessage ..\n@@ -269,7 +269,7 @@ test_expect_success 'left alignment formatting with trunc' '\n \ttest_cmp expected actual\n '\n \n-test_expect_success 'left alignment formatting with trunc. i18n.logOutputEncoding' '\n+test_expect_success ICONV 'left alignment formatting with trunc. i18n.logOutputEncoding' '\n \tgit -c i18n.logOutputEncoding=$test_encoding log --pretty=\"tformat:%<(10,trunc)%s\" >actual &&\n \tqz_to_tab_space <<-\\EOF | iconv -f utf-8 -t $test_encoding >expected &&\n \tmessage ..\n@@ -280,7 +280,7 @@ test_expect_success 'left alignment formatting with trunc. i18n.logOutputEncodin\n \ttest_cmp expected actual\n '\n \n-test_expect_success 'left alignment formatting with ltrunc' '\n+test_expect_success ICONV '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@@ -291,7 +291,7 @@ test_expect_success 'left alignment formatting with ltrunc' '\n \ttest_cmp expected actual\n '\n \n-test_expect_success 'left alignment formatting with ltrunc. i18n.logOutputEncoding' '\n+test_expect_success ICONV 'left alignment formatting with ltrunc. i18n.logOutputEncoding' '\n \tgit -c i18n.logOutputEncoding=$test_encoding log --pretty=\"tformat:%<(10,ltrunc)%s\" >actual &&\n \tqz_to_tab_space <<-EOF | iconv -f utf-8 -t $test_encoding >expected &&\n \t..sage two\n@@ -302,7 +302,7 @@ test_expect_success 'left alignment formatting with ltrunc. i18n.logOutputEncodi\n \ttest_cmp expected actual\n '\n \n-test_expect_success 'left alignment formatting with mtrunc' '\n+test_expect_success ICONV '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@@ -313,7 +313,7 @@ test_expect_success 'left alignment formatting with mtrunc' '\n \ttest_cmp expected actual\n '\n \n-test_expect_success 'left alignment formatting with mtrunc. i18n.logOutputEncoding' '\n+test_expect_success ICONV 'left alignment formatting with mtrunc. i18n.logOutputEncoding' '\n \tgit -c i18n.logOutputEncoding=$test_encoding log --pretty=\"tformat:%<(10,mtrunc)%s\" >actual &&\n \tqz_to_tab_space <<-\\EOF | iconv -f utf-8 -t $test_encoding >expected &&\n \tmess.. two\n@@ -324,7 +324,7 @@ test_expect_success 'left alignment formatting with mtrunc. i18n.logOutputEncodi\n \ttest_cmp expected actual\n '\n \n-test_expect_success 'right alignment formatting' '\n+test_expect_success ICONV 'right alignment formatting' '\n \tgit log --pretty=\"tformat:%>(40)%s\" >actual &&\n \tqz_to_tab_space <<-EOF >expected &&\n \tZ                            message two\n@@ -335,7 +335,7 @@ test_expect_success 'right alignment formatting' '\n \ttest_cmp expected actual\n '\n \n-test_expect_success 'right alignment formatting. i18n.logOutputEncoding' '\n+test_expect_success ICONV 'right alignment formatting. i18n.logOutputEncoding' '\n \tgit -c i18n.logOutputEncoding=$test_encoding log --pretty=\"tformat:%>(40)%s\" >actual &&\n \tqz_to_tab_space <<-EOF | iconv -f utf-8 -t $test_encoding >expected &&\n \tZ                            message two\n@@ -346,7 +346,7 @@ test_expect_success 'right alignment formatting. i18n.logOutputEncoding' '\n \ttest_cmp expected actual\n '\n \n-test_expect_success 'right alignment formatting at the nth column' '\n+test_expect_success ICONV '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@@ -357,7 +357,7 @@ test_expect_success 'right alignment formatting at the nth column' '\n \ttest_cmp expected actual\n '\n \n-test_expect_success 'right alignment formatting at the nth column' '\n+test_expect_success ICONV '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@@ -368,7 +368,7 @@ test_expect_success 'right alignment formatting at the nth column' '\n \ttest_cmp expected actual\n '\n \n-test_expect_success 'right alignment formatting at the nth column. i18n.logOutputEncoding' '\n+test_expect_success ICONV 'right alignment formatting at the nth column. i18n.logOutputEncoding' '\n \tgit -c i18n.logOutputEncoding=$test_encoding log --pretty=\"tformat:%h %>|(40)%s\" >actual &&\n \tqz_to_tab_space <<-EOF | iconv -f utf-8 -t $test_encoding >expected &&\n \t$head1                      message two\n@@ -381,7 +381,7 @@ test_expect_success 'right alignment formatting at the nth column. i18n.logOutpu\n \n # Note: Space between 'message' and 'two' should be in the same column\n # as in previous test.\n-test_expect_success 'right alignment formatting at the nth column with --graph. i18n.logOutputEncoding' '\n+test_expect_success ICONV 'right alignment formatting at the nth column with --graph. i18n.logOutputEncoding' '\n \tgit -c i18n.logOutputEncoding=$test_encoding log --graph --pretty=\"tformat:%h %>|(40)%s\" >actual &&\n \ticonv -f utf-8 -t $test_encoding >expected <<-EOF &&\n \t* $head1                    message two\n@@ -392,7 +392,7 @@ test_expect_success 'right alignment formatting at the nth column with --graph.\n \ttest_cmp expected actual\n '\n \n-test_expect_success 'right alignment formatting with no padding' '\n+test_expect_success ICONV 'right alignment formatting with no padding' '\n \tgit log --pretty=\"tformat:%>(1)%s\" >actual &&\n \tcat <<-EOF >expected &&\n \tmessage two\n@@ -403,7 +403,7 @@ test_expect_success 'right alignment formatting with no padding' '\n \ttest_cmp expected actual\n '\n \n-test_expect_success 'right alignment formatting with no padding and with --graph' '\n+test_expect_success ICONV '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@@ -414,7 +414,7 @@ test_expect_success 'right alignment formatting with no padding and with --graph\n \ttest_cmp expected actual\n '\n \n-test_expect_success 'right alignment formatting with no padding. i18n.logOutputEncoding' '\n+test_expect_success ICONV 'right 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@@ -425,7 +425,7 @@ test_expect_success 'right alignment formatting with no padding. i18n.logOutputE\n \ttest_cmp expected actual\n '\n \n-test_expect_success 'center alignment formatting' '\n+test_expect_success ICONV 'center alignment formatting' '\n \tgit log --pretty=\"tformat:%><(40)%s\" >actual &&\n \tqz_to_tab_space <<-EOF >expected &&\n \tZ             message two              Z\n@@ -436,7 +436,7 @@ test_expect_success 'center alignment formatting' '\n \ttest_cmp expected actual\n '\n \n-test_expect_success 'center alignment formatting. i18n.logOutputEncoding' '\n+test_expect_success ICONV 'center alignment formatting. i18n.logOutputEncoding' '\n \tgit -c i18n.logOutputEncoding=$test_encoding log --pretty=\"tformat:%><(40)%s\" >actual &&\n \tqz_to_tab_space <<-EOF | iconv -f utf-8 -t $test_encoding >expected &&\n \tZ             message two              Z\n@@ -446,7 +446,7 @@ test_expect_success 'center alignment formatting. i18n.logOutputEncoding' '\n \tEOF\n \ttest_cmp expected actual\n '\n-test_expect_success 'center alignment formatting at the nth column' '\n+test_expect_success ICONV '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@@ -457,7 +457,7 @@ test_expect_success 'center alignment formatting at the nth column' '\n \ttest_cmp expected actual\n '\n \n-test_expect_success 'center alignment formatting at the nth column' '\n+test_expect_success ICONV '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@@ -468,7 +468,7 @@ test_expect_success 'center alignment formatting at the nth column' '\n \ttest_cmp expected actual\n '\n \n-test_expect_success 'center alignment formatting at the nth column. i18n.logOutputEncoding' '\n+test_expect_success ICONV 'center alignment formatting at the nth column. i18n.logOutputEncoding' '\n \tgit -c i18n.logOutputEncoding=$test_encoding log --pretty=\"tformat:%h %><|(40)%s\" >actual &&\n \tqz_to_tab_space <<-EOF | iconv -f utf-8 -t $test_encoding >expected &&\n \t$head1           message two          Z\n@@ -479,7 +479,7 @@ test_expect_success 'center alignment formatting at the nth column. i18n.logOutp\n \ttest_cmp expected actual\n '\n \n-test_expect_success 'center alignment formatting with no padding' '\n+test_expect_success ICONV 'center alignment formatting with no padding' '\n \tgit log --pretty=\"tformat:%><(1)%s\" >actual &&\n \tcat <<-EOF >expected &&\n \tmessage two\n@@ -493,7 +493,7 @@ test_expect_success 'center alignment formatting with no padding' '\n # save HEAD's SHA-1 digest (with no abbreviations) to use it below\n # as far as the next test amends HEAD\n old_head1=$(git rev-parse --verify HEAD~0)\n-test_expect_success 'center alignment formatting with no padding. i18n.logOutputEncoding' '\n+test_expect_success ICONV 'center 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@@ -504,7 +504,7 @@ test_expect_success 'center alignment formatting with no padding. i18n.logOutput\n \ttest_cmp expected actual\n '\n \n-test_expect_success 'left/right alignment formatting with stealing' '\n+test_expect_success ICONV 'left/right alignment formatting with stealing' '\n \tgit commit --amend -m short --author \"long long long <long@me.com>\" &&\n \tgit log --pretty=\"tformat:%<(10,trunc)%s%>>(10,ltrunc)% an\" >actual &&\n \tcat <<-\\EOF >expected &&\n@@ -515,7 +515,7 @@ test_expect_success 'left/right alignment formatting with stealing' '\n \tEOF\n \ttest_cmp expected actual\n '\n-test_expect_success 'left/right alignment formatting with stealing. i18n.logOutputEncoding' '\n+test_expect_success ICONV 'left/right alignment formatting with stealing. i18n.logOutputEncoding' '\n \tgit -c i18n.logOutputEncoding=$test_encoding log --pretty=\"tformat:%<(10,trunc)%s%>>(10,ltrunc)% an\" >actual &&\n \tcat <<-\\EOF | iconv -f utf-8 -t $test_encoding >expected &&\n \tshort long  long long\n@@ -564,22 +564,38 @@ test_expect_success 'log decoration properly follows tag chain' '\n \tgit tag -d tag1 &&\n \tgit commit --amend -m shorter &&\n \tgit log --no-walk --tags --pretty=\"%H %d\" --decorate=full >actual &&\n-\tcat <<-EOF >expected &&\n-\t$head2  (tag: refs/tags/message-one)\n-\t$old_head1  (tag: refs/tags/message-two)\n-\t$head1  (tag: refs/tags/tag2)\n-\tEOF\n+\tif test_have_prereq ICONV\n+\tthen\n+\t\tcat <<-EOF >expected\n+\t\t$head2  (tag: refs/tags/message-one)\n+\t\t$old_head1  (tag: refs/tags/message-two)\n+\t\t$head1  (tag: refs/tags/tag2)\n+\t\tEOF\n+\telse\n+\t\tcat <<-EOF >expected\n+\t\t$head2  (tag: refs/tags/message-one)\n+\t\t$old_head1  (tag: refs/tags/tag2, tag: refs/tags/message-two)\n+\t\tEOF\n+\tfi &&\n \tsort -k3 actual >actual1 &&\n \ttest_cmp expected actual1\n '\n \n test_expect_success 'clean log decoration' '\n \tgit log --no-walk --tags --pretty=\"%H %D\" --decorate=full >actual &&\n-\tcat >expected <<-EOF &&\n-\t$head2 tag: refs/tags/message-one\n-\t$old_head1 tag: refs/tags/message-two\n-\t$head1 tag: refs/tags/tag2\n-\tEOF\n+\tif test_have_prereq ICONV\n+\tthen\n+\t\tcat <<-EOF >expected\n+\t\t$head2 tag: refs/tags/message-one\n+\t\t$old_head1 tag: refs/tags/message-two\n+\t\t$head1 tag: refs/tags/tag2\n+\t\tEOF\n+\telse\n+\t\tcat <<-EOF >expected\n+\t\t$head2 tag: refs/tags/message-one\n+\t\t$old_head1 tag: refs/tags/tag2, tag: refs/tags/message-two\n+\t\tEOF\n+\tfi &&\n \tsort -k3 actual >actual1 &&\n \ttest_cmp expected actual1\n '\ndiff --git a/t/t4210-log-i18n.sh b/t/t4210-log-i18n.sh\nindex 7120030b5c6..4a12b2b4979 100755\n--- a/t/t4210-log-i18n.sh\n+++ b/t/t4210-log-i18n.sh\n@@ -5,6 +5,12 @@ test_description='test log with i18n features'\n TEST_PASSES_SANITIZE_LEAK=true\n . ./lib-gettext.sh\n \n+if ! test_have_prereq ICONV\n+then\n+\tskip_all='skipping log i18n tests; iconv not available'\n+\ttest_done\n+fi\n+\n # two forms of é\n utf8_e=$(printf '\\303\\251')\n latin1_e=$(printf '\\351')\ndiff --git a/t/t4254-am-corrupt.sh b/t/t4254-am-corrupt.sh\nindex 661feb60709..cb03522d021 100755\n--- a/t/t4254-am-corrupt.sh\n+++ b/t/t4254-am-corrupt.sh\n@@ -5,6 +5,12 @@ test_description='git am with corrupt input'\n TEST_PASSES_SANITIZE_LEAK=true\n . ./test-lib.sh\n \n+if ! test_have_prereq ICONV\n+then\n+\tskip_all='skipping am encoding corruption tests; iconv not available'\n+\ttest_done\n+fi\n+\n make_mbox_with_nul () {\n \tspace=' '\n \tq_nul_in_subject=\ndiff --git a/t/t5100-mailinfo.sh b/t/t5100-mailinfo.sh\nindex 065156c1f39..23b2f218725 100755\n--- a/t/t5100-mailinfo.sh\n+++ b/t/t5100-mailinfo.sh\n@@ -28,7 +28,12 @@ check_mailinfo () {\n \n for mail in 00*\n do\n-\ttest_expect_success \"mailinfo $mail\" '\n+\tcase \"$mail\" in\n+\t0004)\n+\t\tprereq=ICONV;;\n+\tesac\n+\n+\ttest_expect_success $prereq \"mailinfo $mail\" '\n \t\tcheck_mailinfo \"$mail\" \"\" &&\n \t\tif test -f \"$DATA/msg$mail--scissors\"\n \t\tthen\n@@ -56,7 +61,12 @@ test_expect_success 'split box with rfc2047 samples' \\\n \n for mail in rfc2047/00*\n do\n-\ttest_expect_success \"mailinfo $mail\" '\n+\tcase \"$mail\" in\n+\trfc2047/0001)\n+\t\tprereq=ICONV;;\n+\tesac\n+\n+\ttest_expect_success $prereq \"mailinfo $mail\" '\n \t\tgit mailinfo -u \"$mail-msg\" \"$mail-patch\" <\"$mail\" >\"$mail-info\" &&\n \t\techo msg &&\n \t\ttest_cmp \"$DATA/empty\" \"$mail-msg\" &&\ndiff --git a/t/t5550-http-fetch-dumb.sh b/t/t5550-http-fetch-dumb.sh\nindex 58189c9f7dc..3c873de17ec 100755\n--- a/t/t5550-http-fetch-dumb.sh\n+++ b/t/t5550-http-fetch-dumb.sh\n@@ -344,12 +344,12 @@ test_expect_success 'git client shows text/plain with a charset' '\n \tgrep \"this is the error message\" stderr\n '\n \n-test_expect_success 'http error messages are reencoded' '\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 '\n \n-test_expect_success 'reencoding is robust to whitespace oddities' '\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 '\ndiff --git a/t/t6006-rev-list-format.sh b/t/t6006-rev-list-format.sh\nindex f1623b1c06d..2a01a62a2f3 100755\n--- a/t/t6006-rev-list-format.sh\n+++ b/t/t6006-rev-list-format.sh\n@@ -13,21 +13,41 @@ TEST_PASSES_SANITIZE_LEAK=true\n . \"$TEST_DIRECTORY\"/lib-terminal.sh\n \n test_tick\n-# Tested non-UTF-8 encoding\n-test_encoding=\"ISO8859-1\"\n-\n-# String \"added\" in German\n-# (translated with Google Translate),\n-# encoded in UTF-8, used as a commit log message below.\n-added_utf8_part=$(printf \"\\303\\274\")\n-added_utf8_part_iso88591=$(echo \"$added_utf8_part\" | iconv -f utf-8 -t $test_encoding)\n-added=$(printf \"added (hinzugef${added_utf8_part}gt) foo\")\n-added_iso88591=$(echo \"$added\" | iconv -f utf-8 -t $test_encoding)\n-# same but \"changed\"\n-changed_utf8_part=$(printf \"\\303\\244\")\n-changed_utf8_part_iso88591=$(echo \"$changed_utf8_part\" | iconv -f utf-8 -t $test_encoding)\n-changed=$(printf \"changed (ge${changed_utf8_part}ndert) foo\")\n-changed_iso88591=$(echo \"$changed\" | iconv -f utf-8 -t $test_encoding)\n+\n+if test_have_prereq ICONV\n+then\n+\t# Tested non-UTF-8 encoding\n+\ttest_encoding=\"ISO8859-1\"\n+\n+\t# String \"added\" in German\n+\t# (translated with Google Translate),\n+\t# encoded in UTF-8, used as a commit log message below.\n+\tadded_utf8_part=$(printf \"\\303\\274\")\n+\tadded_utf8_part_iso88591=$(echo \"$added_utf8_part\" | iconv -f utf-8 -t $test_encoding)\n+\tadded=$(printf \"added (hinzugef${added_utf8_part}gt) foo\")\n+\tadded_iso88591=$(echo \"$added\" | iconv -f utf-8 -t $test_encoding)\n+\t# same but \"changed\"\n+\tchanged_utf8_part=$(printf \"\\303\\244\")\n+\tchanged_utf8_part_iso88591=$(echo \"$changed_utf8_part\" | iconv -f utf-8 -t $test_encoding)\n+\tchanged=$(printf \"changed (ge${changed_utf8_part}ndert) foo\")\n+\tchanged_iso88591=$(echo \"$changed\" | iconv -f utf-8 -t $test_encoding)\n+else\n+\t# Tested non-UTF-8 encoding\n+\ttest_encoding=\"UTF-8\"\n+\n+\t# String \"added\" in German\n+\t# (translated with Google Translate),\n+\t# encoded in UTF-8, used as a commit log message below.\n+\tadded_utf8_part=\"u\"\n+\tadded_utf8_part_iso88591=\"u\"\n+\tadded=$(printf \"added (hinzugef${added_utf8_part}gt) foo\")\n+\tadded_iso88591=\"$added\"\n+\t# same but \"changed\"\n+\tchanged_utf8_part=\"a\"\n+\tchanged_utf8_part_iso88591=\"a\"\n+\tchanged=$(printf \"changed (ge${changed_utf8_part}ndert) foo\")\n+\tchanged_iso88591=\"$changed\"\n+fi\n \n # Count of char to truncate\n # Number is chosen so, that non-ACSII characters\n@@ -198,7 +218,7 @@ Thu, 7 Apr 2005 15:13:13 -0700\n 1112911993\n EOF\n \n-test_format encoding %e <<EOF\n+test_format ICONV encoding %e <<EOF\n commit $head2\n $test_encoding\n commit $head1\n@@ -374,7 +394,7 @@ test_expect_success 'setup complex body' '\n \thead3_short=$(git rev-parse --short $head3)\n '\n \n-test_format complex-encoding %e <<EOF\n+test_format ICONV complex-encoding %e <<EOF\n commit $head3\n $test_encoding\n commit $head2\ndiff --git a/t/t7102-reset.sh b/t/t7102-reset.sh\nindex 2add26d7684..e9a6cc72658 100755\n--- a/t/t7102-reset.sh\n+++ b/t/t7102-reset.sh\n@@ -13,21 +13,31 @@ export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME\n TEST_PASSES_SANITIZE_LEAK=true\n . ./test-lib.sh\n \n-commit_msg () {\n-\t# String \"modify 2nd file (changed)\" partly in German\n-\t# (translated with Google Translate),\n-\t# encoded in UTF-8, used as a commit log message below.\n-\tmsg=\"modify 2nd file (ge\\303\\244ndert)\\n\"\n-\tif test -n \"$1\"\n-\tthen\n-\t\tprintf \"$msg\" | iconv -f utf-8 -t \"$1\"\n-\telse\n-\t\tprintf \"$msg\"\n-\tfi\n-}\n-\n-# Tested non-UTF-8 encoding\n-test_encoding=\"ISO8859-1\"\n+if test_have_prereq ICONV\n+then\n+\tcommit_msg () {\n+\t\t# String \"modify 2nd file (changed)\" partly in German\n+\t\t# (translated with Google Translate),\n+\t\t# encoded in UTF-8, used as a commit log message below.\n+\t\tmsg=\"modify 2nd file (ge\\303\\244ndert)\\n\"\n+\t\tif test -n \"$1\"\n+\t\tthen\n+\t\t\tprintf \"$msg\" | iconv -f utf-8 -t \"$1\"\n+\t\telse\n+\t\t\tprintf \"$msg\"\n+\t\tfi\n+\t}\n+\n+\t# Tested non-UTF-8 encoding\n+\ttest_encoding=\"ISO8859-1\"\n+else\n+\tcommit_msg () {\n+\t\techo \"modify 2nd file (geandert)\"\n+\t}\n+\n+\t# Tested non-UTF-8 encoding\n+\ttest_encoding=\"UTF-8\"\n+fi\n \n test_expect_success 'creating initial files and commits' '\n \ttest_tick &&\ndiff --git a/t/t8005-blame-i18n.sh b/t/t8005-blame-i18n.sh\nindex 75da219ed1b..7a1f581c240 100755\n--- a/t/t8005-blame-i18n.sh\n+++ b/t/t8005-blame-i18n.sh\n@@ -3,6 +3,12 @@\n test_description='git blame encoding conversion'\n . ./test-lib.sh\n \n+if ! test_have_prereq ICONV\n+then\n+\tskip_all='skipping blame i18n tests; iconv not available'\n+\ttest_done\n+fi\n+\n . \"$TEST_DIRECTORY\"/t8005/utf8.txt\n . \"$TEST_DIRECTORY\"/t8005/euc-japan.txt\n . \"$TEST_DIRECTORY\"/t8005/sjis.txt\ndiff --git a/t/t9300-fast-import.sh b/t/t9300-fast-import.sh\nindex 3b3c371740a..6224f54d4d2 100755\n--- a/t/t9300-fast-import.sh\n+++ b/t/t9300-fast-import.sh\n@@ -3676,7 +3676,7 @@ test_expect_success !MINGW 'W: get-mark & empty orphan commit with erroneous thi\n ### series X (other new features)\n ###\n \n-test_expect_success 'X: handling encoding' '\n+test_expect_success ICONV 'X: handling encoding' '\n \ttest_tick &&\n \tcat >input <<-INPUT_END &&\n \tcommit refs/heads/encoding\ndiff --git a/t/t9350-fast-export.sh b/t/t9350-fast-export.sh\nindex 2bdc02b4599..9595dfef2ee 100755\n--- a/t/t9350-fast-export.sh\n+++ b/t/t9350-fast-export.sh\n@@ -125,7 +125,7 @@ test_expect_success 'fast-export --show-original-ids | git fast-import' '\n \ttest $MUSS = $(git rev-parse --verify refs/tags/muss)\n '\n \n-test_expect_success 'reencoding iso-8859-7' '\n+test_expect_success ICONV 'reencoding iso-8859-7' '\n \n \ttest_when_finished \"git reset --hard HEAD~1\" &&\n \ttest_config i18n.commitencoding iso-8859-7 &&\n@@ -421,7 +421,7 @@ M 100644 :1 there\n \n EOF\n \n-test_expect_success 'dropping tag of filtered out object' '\n+test_expect_success ICONV 'dropping tag of filtered out object' '\n (\n \tcd limit-by-paths &&\n \tgit fast-export --tag-of-filtered-object=drop mytag -- there > output &&\n@@ -438,7 +438,7 @@ msg\n \n EOF\n \n-test_expect_success 'rewriting tag of filtered out object' '\n+test_expect_success ICONV 'rewriting tag of filtered out object' '\n (\n \tcd limit-by-paths &&\n \tgit fast-export --tag-of-filtered-object=rewrite mytag -- there > output &&\n@@ -667,7 +667,7 @@ M 100644 :13 file\n \n EOF\n \n-test_expect_success 'avoid uninteresting refs' '\n+test_expect_success ICONV 'avoid uninteresting refs' '\n \t> tmp-marks &&\n \tgit fast-export --import-marks=tmp-marks \\\n \t\t--export-marks=tmp-marks main > /dev/null &&\n@@ -686,7 +686,7 @@ from :14\n \n EOF\n \n-test_expect_success 'refs are updated even if no commits need to be exported' '\n+test_expect_success ICONV 'refs are updated even if no commits need to be exported' '\n \t> tmp-marks &&\n \tgit fast-export --import-marks=tmp-marks \\\n \t\t--export-marks=tmp-marks main > /dev/null &&\ndiff --git a/t/test-lib.sh b/t/test-lib.sh\nindex 241198ba95f..a278181a056 100644\n--- a/t/test-lib.sh\n+++ b/t/test-lib.sh\n@@ -1743,6 +1743,7 @@ esac\n \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_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-- \n2.47.0.dirty\n\n"},{"id":"504990","messageId":"eda73d81139e640f4f942818f6035770b7bc9121.1728906490.git.ps@pks.im","threadId":"62330","inReplyTo":"cover.1728906490.git.ps@pks.im","subject":"[PATCH 03/10] t/lib-gitweb: test against the build version of gitweb","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2024-10-14T12:21:18Z","receivedAt":"2024-10-14T12:21:21Z","isPatch":true,"sender":{"key":"ps@pks.im","avatar":"https://avatars.githubusercontent.com/u/4056630?v=4"},"body":"When testing gitweb we set up the CGI script as \"gitweb.perl\", which is\nthe source file of the build target \"gitweb.cgi\". This works alright as\nlong as we run in-tree tests. But we're about to make out-of-tree tests\na reality, and there things will break because \"gitweb.perl\" will not be\nfound in the build directory.\n\nFix this by using \"gitweb.cgi\" instead.\n\nSigned-off-by: Patrick Steinhardt <ps@pks.im>\n---\n t/lib-gitweb.sh | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/t/lib-gitweb.sh b/t/lib-gitweb.sh\nindex 1f32ca66ea5..c64c87fb87d 100644\n--- a/t/lib-gitweb.sh\n+++ b/t/lib-gitweb.sh\n@@ -49,7 +49,7 @@ EOF\n \t\terror \"Cannot find gitweb at $GITWEB_TEST_INSTALLED.\"\n \t\tsay \"# Testing $SCRIPT_NAME\"\n \telse # normal case, use source version of gitweb\n-\t\tSCRIPT_NAME=\"$GIT_BUILD_DIR/gitweb/gitweb.perl\"\n+\t\tSCRIPT_NAME=\"$GIT_BUILD_DIR/gitweb/gitweb.cgi\"\n \tfi\n \texport SCRIPT_NAME\n }\n-- \n2.47.0.dirty\n\n"},{"id":"504991","messageId":"f5700647839a21b5aed0d2dc45e65bed36ddd392.1728906490.git.ps@pks.im","threadId":"62330","inReplyTo":"cover.1728906490.git.ps@pks.im","subject":"[PATCH 04/10] t/lib-gpg: fix setup of GNUPGHOME in MinGW","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2024-10-14T12:21:20Z","receivedAt":"2024-10-14T12:21:24Z","isPatch":true,"sender":{"key":"ps@pks.im","avatar":"https://avatars.githubusercontent.com/u/4056630?v=4"},"body":"In \"t/lib-gpg.sh\" we set up the \"GNUPGHOME\" environment variable to\npoint to a test-specific directory. This is done by using \"$PWD/gpghome\"\nas value, where \"$PWD\" is the current test's trash directory.\n\nThis is broken for MinGW though because \"$PWD\" will use Windows-style\npaths that contain drive letters. What we really want in this context is\na Unix-style path, which we can get by using `$(pwd)` instead. It is\nsomewhat puzzling that nobody ever hit this issue, but it may easily be\nthat nobody ever tests on Windows with GnuPG installed, which would make\nus skip those tests.\n\nAdapt the code accordingly to fix tests using this library.\n\nSigned-off-by: Patrick Steinhardt <ps@pks.im>\n---\n t/lib-gpg.sh | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/t/lib-gpg.sh b/t/lib-gpg.sh\nindex add11e88fc0..3845b6ac449 100644\n--- a/t/lib-gpg.sh\n+++ b/t/lib-gpg.sh\n@@ -6,7 +6,7 @@\n #   executed in an eval'ed subshell that changes the working directory to a\n #   temporary one.\n \n-GNUPGHOME=\"$PWD/gpghome\"\n+GNUPGHOME=\"$(pwd)/gpghome\"\n export GNUPGHOME\n \n test_lazy_prereq GPG '\n-- \n2.47.0.dirty\n\n"},{"id":"504992","messageId":"d082cd92af36610af24985ef2279c4176b1f182f.1728906490.git.ps@pks.im","threadId":"62330","inReplyTo":"cover.1728906490.git.ps@pks.im","subject":"[PATCH 05/10] t1401: make invocation of tar(1) work with Win32-provided one","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2024-10-14T12:21:23Z","receivedAt":"2024-10-14T12:21:29Z","isPatch":true,"sender":{"key":"ps@pks.im","avatar":"https://avatars.githubusercontent.com/u/4056630?v=4"},"body":"Windows nowadays provides a tar(1) binary in \"C:\\Windows\\system32\". This\nversion of tar(1) doesn't seem to handle the case where directory paths\nend with a trailing forward slash. And as we do that in t1401 the result\nis that the test fails.\n\nDrop the trailing slash. Other tests that use tar(1) work alright, this\nis the only instance where it has been failing.\n---\n t/t1401-symbolic-ref.sh | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/t/t1401-symbolic-ref.sh b/t/t1401-symbolic-ref.sh\nindex 5c60d6f812d..90af3f955c0 100755\n--- a/t/t1401-symbolic-ref.sh\n+++ b/t/t1401-symbolic-ref.sh\n@@ -16,7 +16,7 @@ reset_to_sane() {\n test_expect_success 'setup' '\n \tgit symbolic-ref HEAD refs/heads/foo &&\n \ttest_commit file &&\n-\t\"$TAR\" cf .git.tar .git/\n+\t\"$TAR\" cf .git.tar .git\n '\n \n test_expect_success 'symbolic-ref read/write roundtrip' '\n-- \n2.47.0.dirty\n\n"},{"id":"504993","messageId":"a82a6b3df70c36e5e2416ddd8c3b0cad644b925f.1728906490.git.ps@pks.im","threadId":"62330","inReplyTo":"cover.1728906490.git.ps@pks.im","subject":"[PATCH 06/10] t3404: work around platform-specific behaviour on macOS 10.15","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2024-10-14T12:21:29Z","receivedAt":"2024-10-14T12:21:32Z","isPatch":true,"sender":{"key":"ps@pks.im","avatar":"https://avatars.githubusercontent.com/u/4056630?v=4"},"body":"Two of our tests in t3404 use indented HERE docs where leading tabs on\nsome of the lines are actually relevant. The tabs do get removed though,\nand we try to fix this up by using sed(1) to replace leading tabs in the\nactual output, as well. But macOS 10.15 uses an oldish version of sed(1)\nthat has BSD lineage, which does not understand \"\\t\", and thus we fail\nto strip those leading tabs and fail the test.\n\nAddress this issue by using `q_to_tab` such that we do not have to strip\nleading tabs from the actual output.\n\nSigned-off-by: Patrick Steinhardt <ps@pks.im>\n---\n t/t3404-rebase-interactive.sh | 26 ++++++++++++--------------\n 1 file changed, 12 insertions(+), 14 deletions(-)\n\ndiff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh\nindex f171af3061d..7ce75237803 100755\n--- a/t/t3404-rebase-interactive.sh\n+++ b/t/t3404-rebase-interactive.sh\n@@ -1917,18 +1917,17 @@ test_expect_success '--update-refs updates refs correctly' '\n \ttest_cmp_rev HEAD~1 refs/heads/third &&\n \ttest_cmp_rev HEAD refs/heads/no-conflict-branch &&\n \n-\tcat >expect <<-\\EOF &&\n+\tq_to_tab >expect <<-\\EOF &&\n \tSuccessfully rebased and updated refs/heads/update-refs.\n \tUpdated the following refs with --update-refs:\n-\t\trefs/heads/first\n-\t\trefs/heads/no-conflict-branch\n-\t\trefs/heads/second\n-\t\trefs/heads/third\n+\tQrefs/heads/first\n+\tQrefs/heads/no-conflict-branch\n+\tQrefs/heads/second\n+\tQrefs/heads/third\n \tEOF\n \n \t# Clear \"Rebasing (X/Y)\" progress lines and drop leading tabs.\n-\tsed -e \"s/Rebasing.*Successfully/Successfully/g\" -e \"s/^\\t//g\" \\\n-\t\t<err >err.trimmed &&\n+\tsed \"s/Rebasing.*Successfully/Successfully/g\" <err >err.trimmed &&\n \ttest_cmp expect err.trimmed\n '\n \n@@ -2178,19 +2177,18 @@ test_expect_success '--update-refs: check failed ref update' '\n \ttest_must_fail git rebase --continue 2>err &&\n \tgrep \"update_ref failed for ref '\\''refs/heads/second'\\''\" err &&\n \n-\tcat >expect <<-\\EOF &&\n+\tq_to_tab >expect <<-\\EOF &&\n \tUpdated the following refs with --update-refs:\n-\t\trefs/heads/first\n-\t\trefs/heads/no-conflict-branch\n-\t\trefs/heads/third\n+\tQrefs/heads/first\n+\tQrefs/heads/no-conflict-branch\n+\tQrefs/heads/third\n \tFailed to update the following refs with --update-refs:\n-\t\trefs/heads/second\n+\tQrefs/heads/second\n \tEOF\n \n \t# Clear \"Rebasing (X/Y)\" progress lines and drop leading tabs.\n \ttail -n 6 err >err.last &&\n-\tsed -e \"s/Rebasing.*Successfully/Successfully/g\" -e \"s/^\\t//g\" \\\n-\t\t<err.last >err.trimmed &&\n+\tsed \"s/Rebasing.*Successfully/Successfully/g\" <err.last >err.trimmed &&\n \ttest_cmp expect err.trimmed\n '\n \n-- \n2.47.0.dirty\n\n"},{"id":"504994","messageId":"e1b9617f9439ce81172d7fde74369ab12407f5dd.1728906490.git.ps@pks.im","threadId":"62330","inReplyTo":"cover.1728906490.git.ps@pks.im","subject":"[PATCH 07/10] t5500, t5601: skip tests which exercise paths with '[::1]' on Cygwin","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2024-10-14T12:21:31Z","receivedAt":"2024-10-14T12:21:34Z","isPatch":true,"sender":{"key":"ps@pks.im","avatar":"https://avatars.githubusercontent.com/u/4056630?v=4"},"body":"Parsing repositories which contain '[::1]' is broken on Cygwin. It seems\nas if Cygwin is confusing those as drive letter prefixes or something\nlike this, but I couldn't deduce the actual root cause.\n\nMark those tests as broken for now.\n\nSigned-off-by: Patrick Steinhardt <ps@pks.im>\n---\n t/t5500-fetch-pack.sh | 14 ++++++++++----\n t/t5601-clone.sh      | 11 +++++++++--\n 2 files changed, 19 insertions(+), 6 deletions(-)\n\ndiff --git a/t/t5500-fetch-pack.sh b/t/t5500-fetch-pack.sh\nindex 605f17240c1..416522c86ad 100755\n--- a/t/t5500-fetch-pack.sh\n+++ b/t/t5500-fetch-pack.sh\n@@ -774,7 +774,7 @@ do\n \t# file with scheme\n \tfor p in file\n \tdo\n-\t\ttest_expect_success !MINGW \"fetch-pack --diag-url $p://$h/$r\" '\n+\t\ttest_expect_success !WINDOWS \"fetch-pack --diag-url $p://$h/$r\" '\n \t\t\tcheck_prot_path $p://$h/$r $p \"/$r\"\n \t\t'\n \t\ttest_expect_success MINGW \"fetch-pack --diag-url $p://$h/$r\" '\n@@ -784,7 +784,7 @@ do\n \t\t\tcheck_prot_path $p:///$r $p \"/$r\"\n \t\t'\n \t\t# No \"/~\" -> \"~\" conversion for file\n-\t\ttest_expect_success !MINGW \"fetch-pack --diag-url $p://$h/~$r\" '\n+\t\ttest_expect_success !WINDOWS \"fetch-pack --diag-url $p://$h/~$r\" '\n \t\t\tcheck_prot_path $p://$h/~$r $p \"/~$r\"\n \t\t'\n \t\ttest_expect_success MINGW \"fetch-pack --diag-url $p://$h/~$r\" '\n@@ -806,11 +806,17 @@ do\n \tp=ssh\n \tfor h in host [::1]\n \tdo\n-\t\ttest_expect_success \"fetch-pack --diag-url $h:$r\" '\n+\t\texpectation=\"success\"\n+\t\tif test_have_prereq CYGWIN && test \"$h\" = \"[::1]\"\n+\t\tthen\n+\t\t\texpectation=\"failure\"\n+\t\tfi\n+\n+\t\ttest_expect_$expectation \"fetch-pack --diag-url $h:$r\" '\n \t\t\tcheck_prot_host_port_path $h:$r $p \"$h\" NONE \"$r\"\n \t\t'\n \t\t# Do \"/~\" -> \"~\" conversion\n-\t\ttest_expect_success \"fetch-pack --diag-url $h:/~$r\" '\n+\t\ttest_expect_$expectation \"fetch-pack --diag-url $h:/~$r\" '\n \t\t\tcheck_prot_host_port_path $h:/~$r $p \"$h\" NONE \"~$r\"\n \t\t'\n \tdone\ndiff --git a/t/t5601-clone.sh b/t/t5601-clone.sh\nindex 5d7ea147f1a..9fe665eadfb 100755\n--- a/t/t5601-clone.sh\n+++ b/t/t5601-clone.sh\n@@ -530,10 +530,17 @@ do\n \t'\n done\n \n+# Parsing of paths that look like IPv6 addresses is broken on Cygwin.\n+expectation_for_ipv6_tests=success\n+if test_have_prereq CYGWIN\n+then\n+\texpectation_for_ipv6_tests=failure\n+fi\n+\n #ipv6\n for repo in rep rep/home/project 123\n do\n-\ttest_expect_success \"clone [::1]:$repo\" '\n+\ttest_expect_$expectation_for_ipv6_tests \"clone [::1]:$repo\" '\n \t\ttest_clone_url [::1]:$repo ::1 \"$repo\"\n \t'\n done\n@@ -542,7 +549,7 @@ test_expect_success \"clone host:/~repo\" '\n \ttest_clone_url host:/~repo host \"~repo\"\n '\n \n-test_expect_success \"clone [::1]:/~repo\" '\n+test_expect_$expectation_for_ipv6_tests \"clone [::1]:/~repo\" '\n \ttest_clone_url [::1]:/~repo ::1 \"~repo\"\n '\n \n-- \n2.47.0.dirty\n\n"},{"id":"504995","messageId":"b94fd876adb1933e582984ce824398857c2e50fd.1728906490.git.ps@pks.im","threadId":"62330","inReplyTo":"cover.1728906490.git.ps@pks.im","subject":"[PATCH 08/10] t7300: work around platform-specific behaviour with long paths on MinGW","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2024-10-14T12:21:34Z","receivedAt":"2024-10-14T12:21:37Z","isPatch":true,"sender":{"key":"ps@pks.im","avatar":"https://avatars.githubusercontent.com/u/4056630?v=4"},"body":"Windows by default has a restriction in place to only allow paths up to\n260 characters. This restriction can nowadays be lifted by setting a\nregistry key, but is still active by default.\n\nIn t7300 we have one test that exercises the behaviour of git-clean(1)\nwith such long paths. Interestingly enough, this test fails on my system\nthat uses Windows 10 with mingw-w64 installed via MSYS2: instead of\nobserving ENAMETOOLONG, we observe ENOENT. This behaviour is consistent\nacross multiple different environments I have tried.\n\nI cannot say why exactly we observe a different error here, but I would\nnot be surprised if this was either dependent on the Windows version,\nthe version of MinGW, the current working directory of Git or any kind\nof combination of these.\n\nWork around the issue by handling both errors.\n\nSigned-off-by: Patrick Steinhardt <ps@pks.im>\n---\n t/t7300-clean.sh | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/t/t7300-clean.sh b/t/t7300-clean.sh\nindex 0aae0dee670..12ab25296b0 100755\n--- a/t/t7300-clean.sh\n+++ b/t/t7300-clean.sh\n@@ -747,7 +747,7 @@ test_expect_success MINGW 'handle clean & core.longpaths = false nicely' '\n \ttest_must_fail git clean -xdf 2>.git/err &&\n \t# grepping for a strerror string is unportable but it is OK here with\n \t# MINGW prereq\n-\ttest_grep \"too long\" .git/err\n+\ttest_grep -e \"too long\" -e \"No such file or directory\" .git/err\n '\n \n test_expect_success 'clean untracked paths by pathspec' '\n-- \n2.47.0.dirty\n\n"},{"id":"504996","messageId":"8cce69e5ba63d02ef4eb1e8cf56f47443b5bb1dd.1728906490.git.ps@pks.im","threadId":"62330","inReplyTo":"cover.1728906490.git.ps@pks.im","subject":"[PATCH 09/10] builtin/credential-cache: fix missing parameter for stub function","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2024-10-14T12:21:37Z","receivedAt":"2024-10-14T12:21:40Z","isPatch":true,"sender":{"key":"ps@pks.im","avatar":"https://avatars.githubusercontent.com/u/4056630?v=4"},"body":"When not compiling the credential cache we may use a stub function for\n`cmd_credential_cache()`. With commit 9b1cb5070f (builtin: add a\nrepository parameter for builtin functions, 2024-09-13), we have added a\nnew parameter to all of those top-level `cmd_*()` functions, and did\nindeed adapt the non-stubbed-out `cmd_credential_cache()`. But we didn't\nadapt the stubbed-out variant, so the code does not compile.\n\nFix this by adding the missing parameter.\n\nSigned-off-by: Patrick Steinhardt <ps@pks.im>\n---\n builtin/credential-cache.c | 3 ++-\n 1 file changed, 2 insertions(+), 1 deletion(-)\n\ndiff --git a/builtin/credential-cache.c b/builtin/credential-cache.c\nindex 5de8b9123bf..c51f7fc2ade 100644\n--- a/builtin/credential-cache.c\n+++ b/builtin/credential-cache.c\n@@ -189,7 +189,8 @@ int cmd_credential_cache(int argc,\n \n #else\n \n-int cmd_credential_cache(int argc, const char **argv, const char *prefix)\n+int cmd_credential_cache(int argc, const char **argv, const char *prefix,\n+\t\t\t struct repository *repo UNUSED)\n {\n \tconst char * const usage[] = {\n \t\t\"git credential-cache [options] <action>\",\n-- \n2.47.0.dirty\n\n"},{"id":"504997","messageId":"deb30e12a5861410b6c3b7385fe09599ddd0394b.1728906490.git.ps@pks.im","threadId":"62330","inReplyTo":"cover.1728906490.git.ps@pks.im","subject":"[PATCH 10/10] http: fix build error on FreeBSD","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2024-10-14T12:21:39Z","receivedAt":"2024-10-14T12:21:43Z","isPatch":true,"sender":{"key":"ps@pks.im","avatar":"https://avatars.githubusercontent.com/u/4056630?v=4"},"body":"The `result` parameter passed to `http_request_reauth()` may either\npoint to a `struct strbuf` or a `FILE *`, where the `target` parameter\ntells us which of either it actually is. To accommodate for both types\nthe pointer is a `void *`, which we then pass directly to functions\nwithout doing a cast.\n\nThis is fine on most platforms, but it breaks on FreeBSD because\n`fileno()` is implemented as a macro that tries to directly access the\n`FILE *` structure.\n\nFix this issue by storing the `FILE *` in a local variable before we\npass it on to other functions.\n\nSigned-off-by: Patrick Steinhardt <ps@pks.im>\n---\n http.c | 10 ++++++----\n 1 file changed, 6 insertions(+), 4 deletions(-)\n\ndiff --git a/http.c b/http.c\nindex d59e59f66b1..72973175a85 100644\n--- a/http.c\n+++ b/http.c\n@@ -2290,17 +2290,19 @@ static int http_request_reauth(const char *url,\n \t\tcase HTTP_REQUEST_STRBUF:\n \t\t\tstrbuf_reset(result);\n \t\t\tbreak;\n-\t\tcase HTTP_REQUEST_FILE:\n-\t\t\tif (fflush(result)) {\n+\t\tcase HTTP_REQUEST_FILE: {\n+\t\t\tFILE *f = result;\n+\t\t\tif (fflush(f)) {\n \t\t\t\terror_errno(\"unable to flush a file\");\n \t\t\t\treturn HTTP_START_FAILED;\n \t\t\t}\n-\t\t\trewind(result);\n-\t\t\tif (ftruncate(fileno(result), 0) < 0) {\n+\t\t\trewind(f);\n+\t\t\tif (ftruncate(fileno(f), 0) < 0) {\n \t\t\t\terror_errno(\"unable to truncate a file\");\n \t\t\t\treturn HTTP_START_FAILED;\n \t\t\t}\n \t\t\tbreak;\n+\t\t}\n \t\tdefault:\n \t\t\tBUG(\"Unknown http_request target\");\n \t\t}\n-- \n2.47.0.dirty\n\n"},{"id":"505078","messageId":"Zw2Ug71K3FhlC9m2@nand.local","threadId":"62330","inReplyTo":"601670912eeb80cc599c0e7af4ea87c370ae831d.1728906490.git.ps@pks.im","subject":"Re: [PATCH 01/10] t/test-lib: fix quoting of TEST_RESULTS_SAN_FILE","fromName":"Taylor Blau","fromEmail":"me@ttaylorr.com","sentAt":"2024-10-14T22:00:35Z","receivedAt":"2024-10-14T22:00:37Z","isPatch":true,"sender":{"key":"me@ttaylorr.com","avatar":"https://avatars.githubusercontent.com/u/301000140?v=4"},"body":"On Mon, Oct 14, 2024 at 02:21:12PM +0200, Patrick Steinhardt wrote:\n> Properly quote the value to fix the issue while using single-quotes to\n> quote the inner value passed to eval. The issue can be reproduced by\n> t0000 with such a path that contains spaces.\n>\n> Signed-off-by: Patrick Steinhardt <ps@pks.im>\n> ---\n>  t/test-lib.sh | 2 +-\n>  1 file changed, 1 insertion(+), 1 deletion(-)\n>\n> diff --git a/t/test-lib.sh b/t/test-lib.sh\n> index b1a8ee5c002..241198ba95f 100644\n> --- a/t/test-lib.sh\n> +++ b/t/test-lib.sh\n> @@ -1572,7 +1572,7 @@ then\n>\n>  \tprepend_var LSAN_OPTIONS : dedup_token_length=9999\n>  \tprepend_var LSAN_OPTIONS : log_exe_name=1\n> -\tprepend_var LSAN_OPTIONS : log_path=\\\"$TEST_RESULTS_SAN_FILE\\\"\n> +\tprepend_var LSAN_OPTIONS : log_path=\"'$TEST_RESULTS_SAN_FILE'\"\n\nMakes sense.\n\nThanks,\nTaylor\n"},{"id":"505079","messageId":"Zw2V/Xy5niJh9dr9@nand.local","threadId":"62330","inReplyTo":"eda73d81139e640f4f942818f6035770b7bc9121.1728906490.git.ps@pks.im","subject":"Re: [PATCH 03/10] t/lib-gitweb: test against the build version of gitweb","fromName":"Taylor Blau","fromEmail":"me@ttaylorr.com","sentAt":"2024-10-14T22:06:53Z","receivedAt":"2024-10-14T22:06:55Z","isPatch":true,"sender":{"key":"me@ttaylorr.com","avatar":"https://avatars.githubusercontent.com/u/301000140?v=4"},"body":"On Mon, Oct 14, 2024 at 02:21:18PM +0200, Patrick Steinhardt wrote:\n> When testing gitweb we set up the CGI script as \"gitweb.perl\", which is\n> the source file of the build target \"gitweb.cgi\". This works alright as\n> long as we run in-tree tests. But we're about to make out-of-tree tests\n> a reality, and there things will break because \"gitweb.perl\" will not be\n> found in the build directory.\n>\n> Fix this by using \"gitweb.cgi\" instead.\n>\n> Signed-off-by: Patrick Steinhardt <ps@pks.im>\n> ---\n>  t/lib-gitweb.sh | 2 +-\n>  1 file changed, 1 insertion(+), 1 deletion(-)\n>\n> diff --git a/t/lib-gitweb.sh b/t/lib-gitweb.sh\n> index 1f32ca66ea5..c64c87fb87d 100644\n> --- a/t/lib-gitweb.sh\n> +++ b/t/lib-gitweb.sh\n> @@ -49,7 +49,7 @@ EOF\n>  \t\terror \"Cannot find gitweb at $GITWEB_TEST_INSTALLED.\"\n>  \t\tsay \"# Testing $SCRIPT_NAME\"\n>  \telse # normal case, use source version of gitweb\n> -\t\tSCRIPT_NAME=\"$GIT_BUILD_DIR/gitweb/gitweb.perl\"\n> +\t\tSCRIPT_NAME=\"$GIT_BUILD_DIR/gitweb/gitweb.cgi\"\n\nThis one I am a bit confused above. Could the same thing not be\naccomplished with the '$GITWEB_TEST_INSTALLED' variable above?\n\nIf not, why not? And likewise, I believe the \"source version\" part of\nthis comment would need an update.\n\nThanks,\nTaylor\n"},{"id":"505080","messageId":"Zw2WLC0h65LkbMCN@nand.local","threadId":"62330","inReplyTo":"f5700647839a21b5aed0d2dc45e65bed36ddd392.1728906490.git.ps@pks.im","subject":"Re: [PATCH 04/10] t/lib-gpg: fix setup of GNUPGHOME in MinGW","fromName":"Taylor Blau","fromEmail":"me@ttaylorr.com","sentAt":"2024-10-14T22:07:40Z","receivedAt":"2024-10-14T22:07:43Z","isPatch":true,"sender":{"key":"me@ttaylorr.com","avatar":"https://avatars.githubusercontent.com/u/301000140?v=4"},"body":"On Mon, Oct 14, 2024 at 02:21:20PM +0200, Patrick Steinhardt wrote:\n> In \"t/lib-gpg.sh\" we set up the \"GNUPGHOME\" environment variable to\n> point to a test-specific directory. This is done by using \"$PWD/gpghome\"\n> as value, where \"$PWD\" is the current test's trash directory.\n>\n> This is broken for MinGW though because \"$PWD\" will use Windows-style\n> paths that contain drive letters. What we really want in this context is\n> a Unix-style path, which we can get by using `$(pwd)` instead. It is\n> somewhat puzzling that nobody ever hit this issue, but it may easily be\n> that nobody ever tests on Windows with GnuPG installed, which would make\n> us skip those tests.\n\nHeh. I am sure that the story of finding such a failure was probably an\ninteresting one as a result ;-).\n\n> Adapt the code accordingly to fix tests using this library.\n>\n> Signed-off-by: Patrick Steinhardt <ps@pks.im>\n> ---\n>  t/lib-gpg.sh | 2 +-\n>  1 file changed, 1 insertion(+), 1 deletion(-)\n>\n> diff --git a/t/lib-gpg.sh b/t/lib-gpg.sh\n> index add11e88fc0..3845b6ac449 100644\n> --- a/t/lib-gpg.sh\n> +++ b/t/lib-gpg.sh\n> @@ -6,7 +6,7 @@\n>  #   executed in an eval'ed subshell that changes the working directory to a\n>  #   temporary one.\n>\n> -GNUPGHOME=\"$PWD/gpghome\"\n> +GNUPGHOME=\"$(pwd)/gpghome\"\n\nMakes sense. Thanks for finding and fixing.\n\nThanks,\nTaylor\n"},{"id":"505081","messageId":"Zw2WyInmctTHRRmd@nand.local","threadId":"62330","inReplyTo":"e1b9617f9439ce81172d7fde74369ab12407f5dd.1728906490.git.ps@pks.im","subject":"Re: [PATCH 07/10] t5500, t5601: skip tests which exercise paths with '[::1]' on Cygwin","fromName":"Taylor Blau","fromEmail":"me@ttaylorr.com","sentAt":"2024-10-14T22:10:16Z","receivedAt":"2024-10-14T22:10:18Z","isPatch":true,"sender":{"key":"me@ttaylorr.com","avatar":"https://avatars.githubusercontent.com/u/301000140?v=4"},"body":"On Mon, Oct 14, 2024 at 02:21:31PM +0200, Patrick Steinhardt wrote:\n> @@ -806,11 +806,17 @@ do\n>  \tp=ssh\n>  \tfor h in host [::1]\n>  \tdo\n> -\t\ttest_expect_success \"fetch-pack --diag-url $h:$r\" '\n> +\t\texpectation=\"success\"\n> +\t\tif test_have_prereq CYGWIN && test \"$h\" = \"[::1]\"\n> +\t\tthen\n> +\t\t\texpectation=\"failure\"\n> +\t\tfi\n> +\n> +\t\ttest_expect_$expectation \"fetch-pack --diag-url $h:$r\" '\n\nVery clever :-).\n\nI am not sure what is going on here since I have almost no familiarity\nwith Cygwin. But this feels like the sort of thing that Johannes\nSchindelin (CC'd) would know like the back of their hand, so perhaps he\ncan illuminate it for us.\n\nThanks,\nTaylor\n"},{"id":"505082","messageId":"Zw2XP2Zps/nAFwRy@nand.local","threadId":"62330","inReplyTo":"8cce69e5ba63d02ef4eb1e8cf56f47443b5bb1dd.1728906490.git.ps@pks.im","subject":"Re: [PATCH 09/10] builtin/credential-cache: fix missing parameter for stub function","fromName":"Taylor Blau","fromEmail":"me@ttaylorr.com","sentAt":"2024-10-14T22:12:15Z","receivedAt":"2024-10-14T22:12:17Z","isPatch":true,"sender":{"key":"me@ttaylorr.com","avatar":"https://avatars.githubusercontent.com/u/301000140?v=4"},"body":"On Mon, Oct 14, 2024 at 02:21:37PM +0200, Patrick Steinhardt wrote:\n> When not compiling the credential cache we may use a stub function for\n> `cmd_credential_cache()`. With commit 9b1cb5070f (builtin: add a\n> repository parameter for builtin functions, 2024-09-13), we have added a\n> new parameter to all of those top-level `cmd_*()` functions, and did\n> indeed adapt the non-stubbed-out `cmd_credential_cache()`. But we didn't\n> adapt the stubbed-out variant, so the code does not compile.\n>\n> Fix this by adding the missing parameter.\n>\n> Signed-off-by: Patrick Steinhardt <ps@pks.im>\n> ---\n>  builtin/credential-cache.c | 3 ++-\n>  1 file changed, 2 insertions(+), 1 deletion(-)\n>\n> diff --git a/builtin/credential-cache.c b/builtin/credential-cache.c\n> index 5de8b9123bf..c51f7fc2ade 100644\n> --- a/builtin/credential-cache.c\n> +++ b/builtin/credential-cache.c\n> @@ -189,7 +189,8 @@ int cmd_credential_cache(int argc,\n>\n>  #else\n>\n> -int cmd_credential_cache(int argc, const char **argv, const char *prefix)\n> +int cmd_credential_cache(int argc, const char **argv, const char *prefix,\n> +\t\t\t struct repository *repo UNUSED)\n\nOops. Very good catch, thanks.\n\nThanks,\nTaylor\n"},{"id":"505083","messageId":"Zw2XrAkyOvYFwEDp@nand.local","threadId":"62330","inReplyTo":"deb30e12a5861410b6c3b7385fe09599ddd0394b.1728906490.git.ps@pks.im","subject":"Re: [PATCH 10/10] http: fix build error on FreeBSD","fromName":"Taylor Blau","fromEmail":"me@ttaylorr.com","sentAt":"2024-10-14T22:14:04Z","receivedAt":"2024-10-14T22:14:06Z","isPatch":true,"sender":{"key":"me@ttaylorr.com","avatar":"https://avatars.githubusercontent.com/u/301000140?v=4"},"body":"On Mon, Oct 14, 2024 at 02:21:39PM +0200, Patrick Steinhardt wrote:\n> The `result` parameter passed to `http_request_reauth()` may either\n> point to a `struct strbuf` or a `FILE *`, where the `target` parameter\n> tells us which of either it actually is. To accommodate for both types\n> the pointer is a `void *`, which we then pass directly to functions\n> without doing a cast.\n>\n> This is fine on most platforms, but it breaks on FreeBSD because\n> `fileno()` is implemented as a macro that tries to directly access the\n> `FILE *` structure.\n\nHah. I'm sure this was another fun debugging story ;-). Reading this\nmade me chuckle aloud, but the fix you wrote here makes perfect sense to\nme.\n\nThanks,\nTaylor\n"},{"id":"505098","messageId":"CAPig+cS4X=sX84XOoNiw7jVO5Gaze-155Gcd6sO-UzyFXZ1Z3A@mail.gmail.com","threadId":"62330","inReplyTo":"d082cd92af36610af24985ef2279c4176b1f182f.1728906490.git.ps@pks.im","subject":"Re: [PATCH 05/10] t1401: make invocation of tar(1) work with Win32-provided one","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2024-10-14T23:23:29Z","receivedAt":"2024-10-14T23:23:41Z","isPatch":true,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Mon, Oct 14, 2024 at 8:21 AM Patrick Steinhardt <ps@pks.im> wrote:\n> Windows nowadays provides a tar(1) binary in \"C:\\Windows\\system32\". This\n> version of tar(1) doesn't seem to handle the case where directory paths\n> end with a trailing forward slash. And as we do that in t1401 the result\n> is that the test fails.\n>\n> Drop the trailing slash. Other tests that use tar(1) work alright, this\n> is the only instance where it has been failing.\n> ---\n\nMissing sign-off.\n"},{"id":"505101","messageId":"Zw23WxDIeQh9FjJv@nand.local","threadId":"62330","inReplyTo":"CAPig+cS4X=sX84XOoNiw7jVO5Gaze-155Gcd6sO-UzyFXZ1Z3A@mail.gmail.com","subject":"Re: [PATCH 05/10] t1401: make invocation of tar(1) work with Win32-provided one","fromName":"Taylor Blau","fromEmail":"me@ttaylorr.com","sentAt":"2024-10-15T00:29:15Z","receivedAt":"2024-10-15T00:29:18Z","isPatch":true,"sender":{"key":"me@ttaylorr.com","avatar":"https://avatars.githubusercontent.com/u/301000140?v=4"},"body":"On Mon, Oct 14, 2024 at 07:23:29PM -0400, Eric Sunshine wrote:\n> On Mon, Oct 14, 2024 at 8:21 AM Patrick Steinhardt <ps@pks.im> wrote:\n> > Windows nowadays provides a tar(1) binary in \"C:\\Windows\\system32\". This\n> > version of tar(1) doesn't seem to handle the case where directory paths\n> > end with a trailing forward slash. And as we do that in t1401 the result\n> > is that the test fails.\n> >\n> > Drop the trailing slash. Other tests that use tar(1) work alright, this\n> > is the only instance where it has been failing.\n> > ---\n>\n> Missing sign-off.\n\nVery good catch. It sounds like we will see a reroll of this series,\nthen.\n\nThanks,\nTaylor\n"},{"id":"505144","messageId":"Zw5TqKtLOCvXeDEz@pks.im","threadId":"62330","inReplyTo":"Zw2V/Xy5niJh9dr9@nand.local","subject":"Re: [PATCH 03/10] t/lib-gitweb: test against the build version of gitweb","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2024-10-15T11:36:15Z","receivedAt":"2024-10-15T11:36:22Z","isPatch":true,"sender":{"key":"ps@pks.im","avatar":"https://avatars.githubusercontent.com/u/4056630?v=4"},"body":"On Mon, Oct 14, 2024 at 06:06:53PM -0400, Taylor Blau wrote:\n> On Mon, Oct 14, 2024 at 02:21:18PM +0200, Patrick Steinhardt wrote:\n> > When testing gitweb we set up the CGI script as \"gitweb.perl\", which is\n> > the source file of the build target \"gitweb.cgi\". This works alright as\n> > long as we run in-tree tests. But we're about to make out-of-tree tests\n> > a reality, and there things will break because \"gitweb.perl\" will not be\n> > found in the build directory.\n> >\n> > Fix this by using \"gitweb.cgi\" instead.\n> >\n> > Signed-off-by: Patrick Steinhardt <ps@pks.im>\n> > ---\n> >  t/lib-gitweb.sh | 2 +-\n> >  1 file changed, 1 insertion(+), 1 deletion(-)\n> >\n> > diff --git a/t/lib-gitweb.sh b/t/lib-gitweb.sh\n> > index 1f32ca66ea5..c64c87fb87d 100644\n> > --- a/t/lib-gitweb.sh\n> > +++ b/t/lib-gitweb.sh\n> > @@ -49,7 +49,7 @@ EOF\n> >  \t\terror \"Cannot find gitweb at $GITWEB_TEST_INSTALLED.\"\n> >  \t\tsay \"# Testing $SCRIPT_NAME\"\n> >  \telse # normal case, use source version of gitweb\n> > -\t\tSCRIPT_NAME=\"$GIT_BUILD_DIR/gitweb/gitweb.perl\"\n> > +\t\tSCRIPT_NAME=\"$GIT_BUILD_DIR/gitweb/gitweb.cgi\"\n> \n> This one I am a bit confused above. Could the same thing not be\n> accomplished with the '$GITWEB_TEST_INSTALLED' variable above?\n> \n> If not, why not? And likewise, I believe the \"source version\" part of\n> this comment would need an update.\n\nIn theory we can, but it goes against the spirit of its intent. We do\nnot want to test against an installed version, we want to test against\nthe built version. And the built version is not \"gitweb.perl\", which\nstill has the wrong shebang and replacement markers inside, but it is\n\"gitweb.cgi\".\n\nThis used to work because with our Makefile, \"gitweb.cgi\" and\n\"gitweb.perl\" live next to each other in the same directory. But as soon\nas \"$GIT_BUILD_DIR\" points somewhere else that is not the source tree,\nit fails because we cannot find \"gitweb.perl\" anymore.\n\nNow this change here means that you cannot test gitweb without building\nGit first anymore. But I doubt that really worked in practice anyway,\nand I also doubt that this is something we want to cater towards in the\nfirst place.\n\nI'll update the commit message accordinly.\n\nPatrick\n"},{"id":"505145","messageId":"Zw5Vi7P-bQzRX5uW@pks.im","threadId":"62330","inReplyTo":"Zw2XrAkyOvYFwEDp@nand.local","subject":"Re: [PATCH 10/10] http: fix build error on FreeBSD","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2024-10-15T11:44:18Z","receivedAt":"2024-10-15T11:44:24Z","isPatch":true,"sender":{"key":"ps@pks.im","avatar":"https://avatars.githubusercontent.com/u/4056630?v=4"},"body":"On Mon, Oct 14, 2024 at 06:14:04PM -0400, Taylor Blau wrote:\n> On Mon, Oct 14, 2024 at 02:21:39PM +0200, Patrick Steinhardt wrote:\n> > The `result` parameter passed to `http_request_reauth()` may either\n> > point to a `struct strbuf` or a `FILE *`, where the `target` parameter\n> > tells us which of either it actually is. To accommodate for both types\n> > the pointer is a `void *`, which we then pass directly to functions\n> > without doing a cast.\n> >\n> > This is fine on most platforms, but it breaks on FreeBSD because\n> > `fileno()` is implemented as a macro that tries to directly access the\n> > `FILE *` structure.\n> \n> Hah. I'm sure this was another fun debugging story ;-). Reading this\n> made me chuckle aloud, but the fix you wrote here makes perfect sense to\n> me.\n\nI'm sure I've either got less hair or grown more gray hair over the last\ncouple weeks due to all of these weird compatibility issues. Kind of\npuzzling that either nobody else has hit those issues, or alternatively\nthat nobody seems to care. *shrug*\n\nPatrick\n"},{"id":"505146","messageId":"cover.1728992306.git.ps@pks.im","threadId":"62330","inReplyTo":"cover.1728906490.git.ps@pks.im","subject":"[PATCH v2 00/10] Platform compatibility fixes","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2024-10-15T11:45:04Z","receivedAt":"2024-10-15T11:45:10Z","isPatch":true,"sender":{"key":"ps@pks.im","avatar":"https://avatars.githubusercontent.com/u/4056630?v=4"},"body":"Hi,\n\nthis is the second version of my patch series that includes various\ndifferent platform compatibility fixes.\n\nChanges compared to v1:\n\n  - Provide a more in-depth explanation of the gitweb fix.\n\n  - Fix up a stale comment in \"lib-gitweb.sh\".\n\n  - Add a missing signoff.\n\nThanks!\n\nPatrick\n\nPatrick Steinhardt (10):\n  t/test-lib: fix quoting of TEST_RESULTS_SAN_FILE\n  t/test-lib: wire up NO_ICONV prerequisite\n  t/lib-gitweb: test against the build version of gitweb\n  t/lib-gpg: fix setup of GNUPGHOME in MinGW\n  t1401: make invocation of tar(1) work with Win32-provided one\n  t3404: work around platform-specific behaviour on macOS 10.15\n  t5500, t5601: skip tests which exercise paths with '[::1]' on Cygwin\n  t7300: work around platform-specific behaviour with long paths on\n    MinGW\n  builtin/credential-cache: fix missing parameter for stub function\n  http: fix build error on FreeBSD\n\n Makefile                                     |   1 +\n builtin/credential-cache.c                   |   3 +-\n contrib/buildsystems/CMakeLists.txt          |   6 ++\n http.c                                       |  10 +-\n t/lib-gitweb.sh                              |   4 +-\n t/lib-gpg.sh                                 |   2 +-\n t/t0028-working-tree-encoding.sh             |   6 ++\n t/t1401-symbolic-ref.sh                      |   2 +-\n t/t2082-parallel-checkout-attributes.sh      |   2 +-\n t/t3404-rebase-interactive.sh                |  26 +++--\n t/t3434-rebase-i18n.sh                       |   6 ++\n t/t3900-i18n-commit.sh                       |   6 ++\n t/t3901-i18n-patch.sh                        |   6 ++\n t/t4041-diff-submodule-option.sh             |  16 ++-\n t/t4059-diff-submodule-not-initialized.sh    |  16 ++-\n t/t4060-diff-submodule-option-diff-format.sh |  17 ++--\n t/t4201-shortlog.sh                          |   8 +-\n t/t4205-log-pretty-formats.sh                | 102 +++++++++++--------\n t/t4210-log-i18n.sh                          |   6 ++\n t/t4254-am-corrupt.sh                        |   6 ++\n t/t5100-mailinfo.sh                          |  14 ++-\n t/t5500-fetch-pack.sh                        |  14 ++-\n t/t5550-http-fetch-dumb.sh                   |   4 +-\n t/t5601-clone.sh                             |  11 +-\n t/t6006-rev-list-format.sh                   |  54 ++++++----\n t/t7102-reset.sh                             |  40 +++++---\n t/t7300-clean.sh                             |   2 +-\n t/t8005-blame-i18n.sh                        |   6 ++\n t/t9300-fast-import.sh                       |   2 +-\n t/t9350-fast-export.sh                       |  10 +-\n t/test-lib.sh                                |   3 +-\n 31 files changed, 274 insertions(+), 137 deletions(-)\n\nRange-diff against v1:\n 1:  601670912ee =  1:  a514f5d14a7 t/test-lib: fix quoting of TEST_RESULTS_SAN_FILE\n 2:  f1d74c46aa2 =  2:  f6a8582c34a t/test-lib: wire up NO_ICONV prerequisite\n 3:  eda73d81139 !  3:  2e2d208ef1b t/lib-gitweb: test against the build version of gitweb\n    @@ Commit message\n         t/lib-gitweb: test against the build version of gitweb\n     \n         When testing gitweb we set up the CGI script as \"gitweb.perl\", which is\n    -    the source file of the build target \"gitweb.cgi\". This works alright as\n    -    long as we run in-tree tests. But we're about to make out-of-tree tests\n    -    a reality, and there things will break because \"gitweb.perl\" will not be\n    -    found in the build directory.\n    +    the source file of the build target \"gitweb.cgi\". This file doesn't have\n    +    a patched shebang and still contains `++REPLACEMENT++` markers, but\n    +    things generally work because we replace the configuration with our own\n    +    test configuration.\n     \n    -    Fix this by using \"gitweb.cgi\" instead.\n    +    But this only works as long as \"$GIT_BUILD_DIR\" actually points to the\n    +    source tree, because \"gitweb.cgi\" and \"gitweb.perl\" happen to sit next\n    +    to each other. This is not the case though once you have out-of-tree\n    +    builds like with CMake, where the source and built versions live in\n    +    different directories. Consequently, \"$GIT_BUILD_DIR/gitweb/gitweb.perl\"\n    +    won't exist there.\n    +\n    +    While we could ask build systems with out-of-tree builds to instead set\n    +    up GITWEB_TEST_INSTALLED, which allows us to override the location of\n    +    the script, it goes against the spirit of this environment variable. We\n    +    _don't_ want to test against an installed version, we want to use the\n    +    version we have just built.\n    +\n    +    Fix this by using \"gitweb.cgi\" instead. This means that you cannot run\n    +    test scripts without building that file, but in general we do expect\n    +    developers to build stuff before they test it anyway.\n     \n         Signed-off-by: Patrick Steinhardt <ps@pks.im>\n     \n      ## t/lib-gitweb.sh ##\n     @@ t/lib-gitweb.sh: EOF\n    + \t\ttest -f \"$SCRIPT_NAME\" ||\n      \t\terror \"Cannot find gitweb at $GITWEB_TEST_INSTALLED.\"\n      \t\tsay \"# Testing $SCRIPT_NAME\"\n    - \telse # normal case, use source version of gitweb\n    +-\telse # normal case, use source version of gitweb\n     -\t\tSCRIPT_NAME=\"$GIT_BUILD_DIR/gitweb/gitweb.perl\"\n    ++\telse # normal case, use built version of gitweb\n     +\t\tSCRIPT_NAME=\"$GIT_BUILD_DIR/gitweb/gitweb.cgi\"\n      \tfi\n      \texport SCRIPT_NAME\n 4:  f5700647839 =  4:  cc94f6fa648 t/lib-gpg: fix setup of GNUPGHOME in MinGW\n 5:  d082cd92af3 !  5:  58691dd652b t1401: make invocation of tar(1) work with Win32-provided one\n    @@ Commit message\n         Drop the trailing slash. Other tests that use tar(1) work alright, this\n         is the only instance where it has been failing.\n     \n    +    Signed-off-by: Patrick Steinhardt <ps@pks.im>\n    +\n      ## t/t1401-symbolic-ref.sh ##\n     @@ t/t1401-symbolic-ref.sh: reset_to_sane() {\n      test_expect_success 'setup' '\n 6:  a82a6b3df70 =  6:  1daadd82766 t3404: work around platform-specific behaviour on macOS 10.15\n 7:  e1b9617f943 =  7:  374f47bf3de t5500, t5601: skip tests which exercise paths with '[::1]' on Cygwin\n 8:  b94fd876adb =  8:  13c06a8129b t7300: work around platform-specific behaviour with long paths on MinGW\n 9:  8cce69e5ba6 =  9:  5fd78b6d535 builtin/credential-cache: fix missing parameter for stub function\n10:  deb30e12a58 = 10:  9963dc73988 http: fix build error on FreeBSD\n\nbase-commit: ef8ce8f3d4344fd3af049c17eeba5cd20d98b69f\n-- \n2.47.0.72.gef8ce8f3d4.dirty\n\n"},{"id":"505147","messageId":"a514f5d14a7263750f1fa4bcc04e3daf2901c3eb.1728992306.git.ps@pks.im","threadId":"62330","inReplyTo":"cover.1728992306.git.ps@pks.im","subject":"[PATCH v2 01/10] t/test-lib: fix quoting of TEST_RESULTS_SAN_FILE","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2024-10-15T11:45:09Z","receivedAt":"2024-10-15T11:45:13Z","isPatch":true,"sender":{"key":"ps@pks.im","avatar":"https://avatars.githubusercontent.com/u/4056630?v=4"},"body":"When assembling our LSAN_OPTIONS that configure the leak sanitizer we\nend up prepending the string with various different colon-separated\noptions via calls to `prepend_var`. One of the settings we add is the\npath where the sanitizer should store logs, which can be an arbitrary\nfilesystem path.\n\nNaturally, filesystem paths may contain whitespace characters. And while\nit does seem as if we were quoting the value, we use escaped quotes and\nconsequently split up the value if it does contain spaces. This leads to\nthe following error in t0000 when having a value with whitespaces:\n\n    .../t/test-lib.sh: eval: line 64: unexpected EOF while looking for matching `\"'\n    ++ return 1\n    error: last command exited with $?=1\n    not ok 5 - subtest: 3 passing tests\n\nThe error itself is a bit puzzling at first. The basic problem is that\nthe code sees the leading escaped quote during eval, but because we\ntruncate everything after the space character it doesn't see the\ntrailing escaped quote and thus fails to parse the string.\n\nProperly quote the value to fix the issue while using single-quotes to\nquote the inner value passed to eval. The issue can be reproduced by\nt0000 with such a path that contains spaces.\n\nSigned-off-by: Patrick Steinhardt <ps@pks.im>\n---\n t/test-lib.sh | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/t/test-lib.sh b/t/test-lib.sh\nindex b1a8ee5c002..241198ba95f 100644\n--- a/t/test-lib.sh\n+++ b/t/test-lib.sh\n@@ -1572,7 +1572,7 @@ then\n \n \tprepend_var LSAN_OPTIONS : dedup_token_length=9999\n \tprepend_var LSAN_OPTIONS : log_exe_name=1\n-\tprepend_var LSAN_OPTIONS : log_path=\\\"$TEST_RESULTS_SAN_FILE\\\"\n+\tprepend_var LSAN_OPTIONS : log_path=\"'$TEST_RESULTS_SAN_FILE'\"\n \texport LSAN_OPTIONS\n \n elif test \"$GIT_TEST_PASSING_SANITIZE_LEAK\" = \"check\" ||\n-- \n2.47.0.72.gef8ce8f3d4.dirty\n\n"},{"id":"505148","messageId":"f6a8582c34a7b77aa3e2e45298208050333c384a.1728992306.git.ps@pks.im","threadId":"62330","inReplyTo":"cover.1728992306.git.ps@pks.im","subject":"[PATCH v2 02/10] t/test-lib: wire up NO_ICONV prerequisite","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2024-10-15T11:45:11Z","receivedAt":"2024-10-15T11:45:16Z","isPatch":true,"sender":{"key":"ps@pks.im","avatar":"https://avatars.githubusercontent.com/u/4056630?v=4"},"body":"The iconv library is used by Git to reencode files, commit messages and\nother things. As such it is a rather integral part, but given that many\nplatforms nowadays use UTF-8 everywhere you can live without support for\nreencoding in many situations. It is thus optional to build Git with\niconv, and some of our platforms wired up in \"config.mak.uname\" disable\nit. But while we support building without it, running our test suite\nwith \"NO_ICONV=Yes\" causes many test failures.\n\nWire up a new test prerequisite ICONV that gets populated via our\nGIT-BUILD-OPTIONS. Annotate failing tests accordingly.\n\nNote that this commit does not do a deep dive into every single test to\nassess whether the failure is expected or not. Most of the tests do\nsmell like the expected kind of failure though.\n\nFurther note that there are several \"!MINGW\" conditions in t4201, and\nall of these fail due to iconv-related errors. This is quite likely a\nleftover from times before dce7d29551 (msvc: support building Git using\nMS Visual C++, 2019-06-25), which switched Windows-based builds over\nfrom \"NO_ICONV=YesPlease\" to \"NEEDS_LIBICONV=YesPlease\". Consequently,\nadapt those tests to also use the new ICONV prerequisite.\n\nSigned-off-by: Patrick Steinhardt <ps@pks.im>\n---\n Makefile                                     |   1 +\n contrib/buildsystems/CMakeLists.txt          |   6 ++\n t/t0028-working-tree-encoding.sh             |   6 ++\n t/t2082-parallel-checkout-attributes.sh      |   2 +-\n t/t3434-rebase-i18n.sh                       |   6 ++\n t/t3900-i18n-commit.sh                       |   6 ++\n t/t3901-i18n-patch.sh                        |   6 ++\n t/t4041-diff-submodule-option.sh             |  16 ++-\n t/t4059-diff-submodule-not-initialized.sh    |  16 ++-\n t/t4060-diff-submodule-option-diff-format.sh |  17 ++--\n t/t4201-shortlog.sh                          |   8 +-\n t/t4205-log-pretty-formats.sh                | 102 +++++++++++--------\n t/t4210-log-i18n.sh                          |   6 ++\n t/t4254-am-corrupt.sh                        |   6 ++\n t/t5100-mailinfo.sh                          |  14 ++-\n t/t5550-http-fetch-dumb.sh                   |   4 +-\n t/t6006-rev-list-format.sh                   |  54 ++++++----\n t/t7102-reset.sh                             |  40 +++++---\n t/t8005-blame-i18n.sh                        |   6 ++\n t/t9300-fast-import.sh                       |   2 +-\n t/t9350-fast-export.sh                       |  10 +-\n t/test-lib.sh                                |   1 +\n 22 files changed, 229 insertions(+), 106 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex feeed6f9321..5db10347341 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -3171,6 +3171,7 @@ GIT-BUILD-OPTIONS: FORCE\n \t@echo PYTHON_PATH=\\''$(subst ','\\'',$(PYTHON_PATH_SQ))'\\' >>$@+\n \t@echo TAR=\\''$(subst ','\\'',$(subst ','\\'',$(TAR)))'\\' >>$@+\n \t@echo NO_CURL=\\''$(subst ','\\'',$(subst ','\\'',$(NO_CURL)))'\\' >>$@+\n+\t@echo NO_ICONV=\\''$(subst ','\\'',$(subst ','\\'',$(NO_ICONV)))'\\' >>$@+\n \t@echo NO_EXPAT=\\''$(subst ','\\'',$(subst ','\\'',$(NO_EXPAT)))'\\' >>$@+\n \t@echo USE_LIBPCRE2=\\''$(subst ','\\'',$(subst ','\\'',$(USE_LIBPCRE2)))'\\' >>$@+\n \t@echo NO_PERL=\\''$(subst ','\\'',$(subst ','\\'',$(NO_PERL)))'\\' >>$@+\ndiff --git a/contrib/buildsystems/CMakeLists.txt b/contrib/buildsystems/CMakeLists.txt\nindex 62af7b33d2f..1384c0eb6d3 100644\n--- a/contrib/buildsystems/CMakeLists.txt\n+++ b/contrib/buildsystems/CMakeLists.txt\n@@ -1109,6 +1109,7 @@ set(DIFF diff)\n set(PYTHON_PATH /usr/bin/python)\n set(TAR tar)\n set(NO_CURL )\n+set(NO_ICONV )\n set(NO_EXPAT )\n set(USE_LIBPCRE2 )\n set(NO_PERL )\n@@ -1122,6 +1123,10 @@ if(NOT CURL_FOUND)\n \tset(NO_CURL 1)\n endif()\n \n+if(NOT Iconv_FOUND)\n+\tSET(NO_ICONV 1)\n+endif()\n+\n if(NOT EXPAT_FOUND)\n \tset(NO_EXPAT 1)\n endif()\n@@ -1145,6 +1150,7 @@ file(APPEND ${CMAKE_BINARY_DIR}/GIT-BUILD-OPTIONS \"DIFF='${DIFF}'\\n\")\n file(APPEND ${CMAKE_BINARY_DIR}/GIT-BUILD-OPTIONS \"PYTHON_PATH='${PYTHON_PATH}'\\n\")\n file(APPEND ${CMAKE_BINARY_DIR}/GIT-BUILD-OPTIONS \"TAR='${TAR}'\\n\")\n file(APPEND ${CMAKE_BINARY_DIR}/GIT-BUILD-OPTIONS \"NO_CURL='${NO_CURL}'\\n\")\n+file(APPEND ${CMAKE_BINARY_DIR}/GIT-BUILD-OPTIONS \"NO_ICONV='${NO_ICONV}'\\n\")\n file(APPEND ${CMAKE_BINARY_DIR}/GIT-BUILD-OPTIONS \"NO_EXPAT='${NO_EXPAT}'\\n\")\n file(APPEND ${CMAKE_BINARY_DIR}/GIT-BUILD-OPTIONS \"NO_PERL='${NO_PERL}'\\n\")\n file(APPEND ${CMAKE_BINARY_DIR}/GIT-BUILD-OPTIONS \"NO_PTHREADS='${NO_PTHREADS}'\\n\")\ndiff --git a/t/t0028-working-tree-encoding.sh b/t/t0028-working-tree-encoding.sh\nindex ad151a34670..510da4ca12d 100755\n--- a/t/t0028-working-tree-encoding.sh\n+++ b/t/t0028-working-tree-encoding.sh\n@@ -12,6 +12,12 @@ TEST_CREATE_REPO_NO_TEMPLATE=1\n \n GIT_TRACE_WORKING_TREE_ENCODING=1 && export GIT_TRACE_WORKING_TREE_ENCODING\n \n+if ! test_have_prereq ICONV\n+then\n+\tskip_all='skipping working tree encoding tests; iconv not available'\n+\ttest_done\n+fi\n+\n test_expect_success 'setup test files' '\n \tgit config core.eol lf &&\n \ndiff --git a/t/t2082-parallel-checkout-attributes.sh b/t/t2082-parallel-checkout-attributes.sh\nindex aec55496eb1..a040aa54cee 100755\n--- a/t/t2082-parallel-checkout-attributes.sh\n+++ b/t/t2082-parallel-checkout-attributes.sh\n@@ -34,7 +34,7 @@ test_expect_success 'parallel-checkout with ident' '\n \t)\n '\n \n-test_expect_success 'parallel-checkout with re-encoding' '\n+test_expect_success ICONV 'parallel-checkout with re-encoding' '\n \tset_checkout_config 2 0 &&\n \tgit init encoding &&\n \t(\ndiff --git a/t/t3434-rebase-i18n.sh b/t/t3434-rebase-i18n.sh\nindex 26a48d6b103..97fc9a23f21 100755\n--- a/t/t3434-rebase-i18n.sh\n+++ b/t/t3434-rebase-i18n.sh\n@@ -20,6 +20,12 @@ export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME\n TEST_PASSES_SANITIZE_LEAK=true\n . ./test-lib.sh\n \n+if ! test_have_prereq ICONV\n+then\n+\tskip_all='skipping rebase i18n tests; iconv not available'\n+\ttest_done\n+fi\n+\n compare_msg () {\n \ticonv -f \"$2\" -t \"$3\" \"$TEST_DIRECTORY/t3434/$1\" >expect &&\n \tgit cat-file commit HEAD >raw &&\ndiff --git a/t/t3900-i18n-commit.sh b/t/t3900-i18n-commit.sh\nindex db7b403bc15..9d4b5ab1f95 100755\n--- a/t/t3900-i18n-commit.sh\n+++ b/t/t3900-i18n-commit.sh\n@@ -8,6 +8,12 @@ test_description='commit and log output encodings'\n TEST_PASSES_SANITIZE_LEAK=true\n . ./test-lib.sh\n \n+if ! test_have_prereq ICONV\n+then\n+\tskip_all='skipping commit i18n tests; iconv not available'\n+\ttest_done\n+fi\n+\n compare_with () {\n \tgit show -s $1 | sed -e '1,/^$/d' -e 's/^    //' >current &&\n \tcase \"$3\" in\ndiff --git a/t/t3901-i18n-patch.sh b/t/t3901-i18n-patch.sh\nindex 5f0b9afc3fa..e0659c92935 100755\n--- a/t/t3901-i18n-patch.sh\n+++ b/t/t3901-i18n-patch.sh\n@@ -11,6 +11,12 @@ export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME\n TEST_PASSES_SANITIZE_LEAK=true\n . ./test-lib.sh\n \n+if ! test_have_prereq ICONV\n+then\n+\tskip_all='skipping patch i18n tests; iconv not available'\n+\ttest_done\n+fi\n+\n check_encoding () {\n \t# Make sure characters are not corrupted\n \tcnt=\"$1\" header=\"$2\" i=1 j=0\ndiff --git a/t/t4041-diff-submodule-option.sh b/t/t4041-diff-submodule-option.sh\nindex 8fc40e75eb3..aa149e0085e 100755\n--- a/t/t4041-diff-submodule-option.sh\n+++ b/t/t4041-diff-submodule-option.sh\n@@ -15,12 +15,18 @@ export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME\n TEST_PASSES_SANITIZE_LEAK=true\n . ./test-lib.sh\n \n-# Tested non-UTF-8 encoding\n-test_encoding=\"ISO8859-1\"\n+# Test non-UTF-8 encoding in case iconv is available.\n+if test_have_prereq ICONV\n+then\n+\ttest_encoding=\"ISO8859-1\"\n+\t# String \"added\" in German (translated with Google Translate), encoded in UTF-8,\n+\t# used in sample commit log messages in add_file() function below.\n+\tadded=$(printf \"hinzugef\\303\\274gt\")\n+else\n+\ttest_encoding=\"UTF-8\"\n+\tadded=\"added\"\n+fi\n \n-# String \"added\" in German (translated with Google Translate), encoded in UTF-8,\n-# used in sample commit log messages in add_file() function below.\n-added=$(printf \"hinzugef\\303\\274gt\")\n add_file () {\n \t(\n \t\tcd \"$1\" &&\ndiff --git a/t/t4059-diff-submodule-not-initialized.sh b/t/t4059-diff-submodule-not-initialized.sh\nindex 668f5263038..28fd3cdb154 100755\n--- a/t/t4059-diff-submodule-not-initialized.sh\n+++ b/t/t4059-diff-submodule-not-initialized.sh\n@@ -12,12 +12,18 @@ initialized previously but the checkout has since been removed.\n TEST_PASSES_SANITIZE_LEAK=true\n . ./test-lib.sh\n \n-# Tested non-UTF-8 encoding\n-test_encoding=\"ISO8859-1\"\n \n-# String \"added\" in German (translated with Google Translate), encoded in UTF-8,\n-# used in sample commit log messages in add_file() function below.\n-added=$(printf \"hinzugef\\303\\274gt\")\n+# Test non-UTF-8 encoding in case iconv is available.\n+if test_have_prereq ICONV\n+then\n+\ttest_encoding=\"ISO8859-1\"\n+\t# String \"added\" in German (translated with Google Translate), encoded in UTF-8,\n+\t# used in sample commit log messages in add_file() function below.\n+\tadded=$(printf \"hinzugef\\303\\274gt\")\n+else\n+\ttest_encoding=\"UTF-8\"\n+\tadded=\"added\"\n+fi\n \n add_file () {\n \t(\ndiff --git a/t/t4060-diff-submodule-option-diff-format.sh b/t/t4060-diff-submodule-option-diff-format.sh\nindex 8ce67442d96..918334fa4c8 100755\n--- a/t/t4060-diff-submodule-option-diff-format.sh\n+++ b/t/t4060-diff-submodule-option-diff-format.sh\n@@ -13,12 +13,17 @@ This test tries to verify the sanity of --submodule=diff option of git diff.\n TEST_PASSES_SANITIZE_LEAK=true\n . ./test-lib.sh\n \n-# Tested non-UTF-8 encoding\n-test_encoding=\"ISO8859-1\"\n-\n-# String \"added\" in German (translated with Google Translate), encoded in UTF-8,\n-# used in sample commit log messages in add_file() function below.\n-added=$(printf \"hinzugef\\303\\274gt\")\n+# Test non-UTF-8 encoding in case iconv is available.\n+if test_have_prereq ICONV\n+then\n+\ttest_encoding=\"ISO8859-1\"\n+\t# String \"added\" in German (translated with Google Translate), encoded in UTF-8,\n+\t# used in sample commit log messages in add_file() function below.\n+\tadded=$(printf \"hinzugef\\303\\274gt\")\n+else\n+\ttest_encoding=\"UTF-8\"\n+\tadded=\"added\"\n+fi\n \n add_file () {\n \t(\ndiff --git a/t/t4201-shortlog.sh b/t/t4201-shortlog.sh\nindex c20c8857244..680e707ba1e 100755\n--- a/t/t4201-shortlog.sh\n+++ b/t/t4201-shortlog.sh\n@@ -105,7 +105,7 @@ test_expect_success 'output from user-defined format is re-wrapped' '\n \ttest_cmp expect log.predictable\n '\n \n-test_expect_success !MINGW 'shortlog wrapping' '\n+test_expect_success ICONV 'shortlog wrapping' '\n \tcat >expect <<\\EOF &&\n A U Thor (5):\n       Test\n@@ -126,13 +126,13 @@ EOF\n \ttest_cmp expect out\n '\n \n-test_expect_success !MINGW 'shortlog from non-git directory' '\n+test_expect_success ICONV 'shortlog from non-git directory' '\n \tgit log --no-expand-tabs HEAD >log &&\n \tGIT_DIR=non-existing git shortlog -w <log >out &&\n \ttest_cmp expect out\n '\n \n-test_expect_success !MINGW 'shortlog can read --format=raw output' '\n+test_expect_success ICONV 'shortlog can read --format=raw output' '\n \tgit log --format=raw HEAD >log &&\n \tGIT_DIR=non-existing git shortlog -w <log >out &&\n \ttest_cmp expect out\n@@ -182,7 +182,7 @@ $DSCHO (2):\n \n EOF\n \n-test_expect_success !MINGW 'shortlog encoding' '\n+test_expect_success ICONV 'shortlog encoding' '\n \tgit reset --hard \"$commit\" &&\n \tgit config --unset i18n.commitencoding &&\n \techo 2 > a1 &&\ndiff --git a/t/t4205-log-pretty-formats.sh b/t/t4205-log-pretty-formats.sh\nindex eb63ce011fa..dbbd6125510 100755\n--- a/t/t4205-log-pretty-formats.sh\n+++ b/t/t4205-log-pretty-formats.sh\n@@ -114,19 +114,19 @@ test_expect_success 'alias loop' '\n \ttest_must_fail git log --pretty=test-foo\n '\n \n-test_expect_success 'NUL separation' '\n+test_expect_success ICONV '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 'NUL termination' '\n+test_expect_success ICONV '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 'NUL separation with --stat' '\n+test_expect_success ICONV '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@@ -181,7 +181,7 @@ test_expect_success 'setup more commits' '\n \thead4=$(git rev-parse --verify --short HEAD~3)\n '\n \n-test_expect_success 'left alignment formatting' '\n+test_expect_success ICONV 'left alignment formatting' '\n \tgit log --pretty=\"tformat:%<(40)%s\" >actual &&\n \tqz_to_tab_space <<-EOF >expected &&\n \tmessage two                            Z\n@@ -192,7 +192,7 @@ test_expect_success 'left alignment formatting' '\n \ttest_cmp expected actual\n '\n \n-test_expect_success 'left alignment formatting. i18n.logOutputEncoding' '\n+test_expect_success ICONV 'left alignment formatting. i18n.logOutputEncoding' '\n \tgit -c i18n.logOutputEncoding=$test_encoding log --pretty=\"tformat:%<(40)%s\" >actual &&\n \tqz_to_tab_space <<-EOF | iconv -f utf-8 -t $test_encoding >expected &&\n \tmessage two                            Z\n@@ -203,7 +203,7 @@ test_expect_success 'left alignment formatting. i18n.logOutputEncoding' '\n \ttest_cmp expected actual\n '\n \n-test_expect_success 'left alignment formatting at the nth column' '\n+test_expect_success ICONV '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@@ -214,7 +214,7 @@ test_expect_success 'left alignment formatting at the nth column' '\n \ttest_cmp expected actual\n '\n \n-test_expect_success 'left alignment formatting at the nth column' '\n+test_expect_success ICONV '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@@ -225,7 +225,7 @@ test_expect_success 'left alignment formatting at the nth column' '\n \ttest_cmp expected actual\n '\n \n-test_expect_success 'left alignment formatting at the nth column. i18n.logOutputEncoding' '\n+test_expect_success ICONV 'left alignment formatting at the nth column. i18n.logOutputEncoding' '\n \tgit -c i18n.logOutputEncoding=$test_encoding log --pretty=\"tformat:%h %<|(40)%s\" >actual &&\n \tqz_to_tab_space <<-EOF | iconv -f utf-8 -t $test_encoding >expected &&\n \t$head1 message two                    Z\n@@ -236,7 +236,7 @@ test_expect_success 'left alignment formatting at the nth column. i18n.logOutput\n \ttest_cmp expected actual\n '\n \n-test_expect_success 'left alignment formatting with no padding' '\n+test_expect_success ICONV 'left alignment formatting with no padding' '\n \tgit log --pretty=\"tformat:%<(1)%s\" >actual &&\n \tcat <<-EOF >expected &&\n \tmessage two\n@@ -258,7 +258,7 @@ test_expect_success 'left alignment formatting with no padding. i18n.logOutputEn\n \ttest_cmp expected actual\n '\n \n-test_expect_success 'left alignment formatting with trunc' '\n+test_expect_success ICONV 'left alignment formatting with trunc' '\n \tgit log --pretty=\"tformat:%<(10,trunc)%s\" >actual &&\n \tqz_to_tab_space <<-\\EOF >expected &&\n \tmessage ..\n@@ -269,7 +269,7 @@ test_expect_success 'left alignment formatting with trunc' '\n \ttest_cmp expected actual\n '\n \n-test_expect_success 'left alignment formatting with trunc. i18n.logOutputEncoding' '\n+test_expect_success ICONV 'left alignment formatting with trunc. i18n.logOutputEncoding' '\n \tgit -c i18n.logOutputEncoding=$test_encoding log --pretty=\"tformat:%<(10,trunc)%s\" >actual &&\n \tqz_to_tab_space <<-\\EOF | iconv -f utf-8 -t $test_encoding >expected &&\n \tmessage ..\n@@ -280,7 +280,7 @@ test_expect_success 'left alignment formatting with trunc. i18n.logOutputEncodin\n \ttest_cmp expected actual\n '\n \n-test_expect_success 'left alignment formatting with ltrunc' '\n+test_expect_success ICONV '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@@ -291,7 +291,7 @@ test_expect_success 'left alignment formatting with ltrunc' '\n \ttest_cmp expected actual\n '\n \n-test_expect_success 'left alignment formatting with ltrunc. i18n.logOutputEncoding' '\n+test_expect_success ICONV 'left alignment formatting with ltrunc. i18n.logOutputEncoding' '\n \tgit -c i18n.logOutputEncoding=$test_encoding log --pretty=\"tformat:%<(10,ltrunc)%s\" >actual &&\n \tqz_to_tab_space <<-EOF | iconv -f utf-8 -t $test_encoding >expected &&\n \t..sage two\n@@ -302,7 +302,7 @@ test_expect_success 'left alignment formatting with ltrunc. i18n.logOutputEncodi\n \ttest_cmp expected actual\n '\n \n-test_expect_success 'left alignment formatting with mtrunc' '\n+test_expect_success ICONV '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@@ -313,7 +313,7 @@ test_expect_success 'left alignment formatting with mtrunc' '\n \ttest_cmp expected actual\n '\n \n-test_expect_success 'left alignment formatting with mtrunc. i18n.logOutputEncoding' '\n+test_expect_success ICONV 'left alignment formatting with mtrunc. i18n.logOutputEncoding' '\n \tgit -c i18n.logOutputEncoding=$test_encoding log --pretty=\"tformat:%<(10,mtrunc)%s\" >actual &&\n \tqz_to_tab_space <<-\\EOF | iconv -f utf-8 -t $test_encoding >expected &&\n \tmess.. two\n@@ -324,7 +324,7 @@ test_expect_success 'left alignment formatting with mtrunc. i18n.logOutputEncodi\n \ttest_cmp expected actual\n '\n \n-test_expect_success 'right alignment formatting' '\n+test_expect_success ICONV 'right alignment formatting' '\n \tgit log --pretty=\"tformat:%>(40)%s\" >actual &&\n \tqz_to_tab_space <<-EOF >expected &&\n \tZ                            message two\n@@ -335,7 +335,7 @@ test_expect_success 'right alignment formatting' '\n \ttest_cmp expected actual\n '\n \n-test_expect_success 'right alignment formatting. i18n.logOutputEncoding' '\n+test_expect_success ICONV 'right alignment formatting. i18n.logOutputEncoding' '\n \tgit -c i18n.logOutputEncoding=$test_encoding log --pretty=\"tformat:%>(40)%s\" >actual &&\n \tqz_to_tab_space <<-EOF | iconv -f utf-8 -t $test_encoding >expected &&\n \tZ                            message two\n@@ -346,7 +346,7 @@ test_expect_success 'right alignment formatting. i18n.logOutputEncoding' '\n \ttest_cmp expected actual\n '\n \n-test_expect_success 'right alignment formatting at the nth column' '\n+test_expect_success ICONV '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@@ -357,7 +357,7 @@ test_expect_success 'right alignment formatting at the nth column' '\n \ttest_cmp expected actual\n '\n \n-test_expect_success 'right alignment formatting at the nth column' '\n+test_expect_success ICONV '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@@ -368,7 +368,7 @@ test_expect_success 'right alignment formatting at the nth column' '\n \ttest_cmp expected actual\n '\n \n-test_expect_success 'right alignment formatting at the nth column. i18n.logOutputEncoding' '\n+test_expect_success ICONV 'right alignment formatting at the nth column. i18n.logOutputEncoding' '\n \tgit -c i18n.logOutputEncoding=$test_encoding log --pretty=\"tformat:%h %>|(40)%s\" >actual &&\n \tqz_to_tab_space <<-EOF | iconv -f utf-8 -t $test_encoding >expected &&\n \t$head1                      message two\n@@ -381,7 +381,7 @@ test_expect_success 'right alignment formatting at the nth column. i18n.logOutpu\n \n # Note: Space between 'message' and 'two' should be in the same column\n # as in previous test.\n-test_expect_success 'right alignment formatting at the nth column with --graph. i18n.logOutputEncoding' '\n+test_expect_success ICONV 'right alignment formatting at the nth column with --graph. i18n.logOutputEncoding' '\n \tgit -c i18n.logOutputEncoding=$test_encoding log --graph --pretty=\"tformat:%h %>|(40)%s\" >actual &&\n \ticonv -f utf-8 -t $test_encoding >expected <<-EOF &&\n \t* $head1                    message two\n@@ -392,7 +392,7 @@ test_expect_success 'right alignment formatting at the nth column with --graph.\n \ttest_cmp expected actual\n '\n \n-test_expect_success 'right alignment formatting with no padding' '\n+test_expect_success ICONV 'right alignment formatting with no padding' '\n \tgit log --pretty=\"tformat:%>(1)%s\" >actual &&\n \tcat <<-EOF >expected &&\n \tmessage two\n@@ -403,7 +403,7 @@ test_expect_success 'right alignment formatting with no padding' '\n \ttest_cmp expected actual\n '\n \n-test_expect_success 'right alignment formatting with no padding and with --graph' '\n+test_expect_success ICONV '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@@ -414,7 +414,7 @@ test_expect_success 'right alignment formatting with no padding and with --graph\n \ttest_cmp expected actual\n '\n \n-test_expect_success 'right alignment formatting with no padding. i18n.logOutputEncoding' '\n+test_expect_success ICONV 'right 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@@ -425,7 +425,7 @@ test_expect_success 'right alignment formatting with no padding. i18n.logOutputE\n \ttest_cmp expected actual\n '\n \n-test_expect_success 'center alignment formatting' '\n+test_expect_success ICONV 'center alignment formatting' '\n \tgit log --pretty=\"tformat:%><(40)%s\" >actual &&\n \tqz_to_tab_space <<-EOF >expected &&\n \tZ             message two              Z\n@@ -436,7 +436,7 @@ test_expect_success 'center alignment formatting' '\n \ttest_cmp expected actual\n '\n \n-test_expect_success 'center alignment formatting. i18n.logOutputEncoding' '\n+test_expect_success ICONV 'center alignment formatting. i18n.logOutputEncoding' '\n \tgit -c i18n.logOutputEncoding=$test_encoding log --pretty=\"tformat:%><(40)%s\" >actual &&\n \tqz_to_tab_space <<-EOF | iconv -f utf-8 -t $test_encoding >expected &&\n \tZ             message two              Z\n@@ -446,7 +446,7 @@ test_expect_success 'center alignment formatting. i18n.logOutputEncoding' '\n \tEOF\n \ttest_cmp expected actual\n '\n-test_expect_success 'center alignment formatting at the nth column' '\n+test_expect_success ICONV '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@@ -457,7 +457,7 @@ test_expect_success 'center alignment formatting at the nth column' '\n \ttest_cmp expected actual\n '\n \n-test_expect_success 'center alignment formatting at the nth column' '\n+test_expect_success ICONV '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@@ -468,7 +468,7 @@ test_expect_success 'center alignment formatting at the nth column' '\n \ttest_cmp expected actual\n '\n \n-test_expect_success 'center alignment formatting at the nth column. i18n.logOutputEncoding' '\n+test_expect_success ICONV 'center alignment formatting at the nth column. i18n.logOutputEncoding' '\n \tgit -c i18n.logOutputEncoding=$test_encoding log --pretty=\"tformat:%h %><|(40)%s\" >actual &&\n \tqz_to_tab_space <<-EOF | iconv -f utf-8 -t $test_encoding >expected &&\n \t$head1           message two          Z\n@@ -479,7 +479,7 @@ test_expect_success 'center alignment formatting at the nth column. i18n.logOutp\n \ttest_cmp expected actual\n '\n \n-test_expect_success 'center alignment formatting with no padding' '\n+test_expect_success ICONV 'center alignment formatting with no padding' '\n \tgit log --pretty=\"tformat:%><(1)%s\" >actual &&\n \tcat <<-EOF >expected &&\n \tmessage two\n@@ -493,7 +493,7 @@ test_expect_success 'center alignment formatting with no padding' '\n # save HEAD's SHA-1 digest (with no abbreviations) to use it below\n # as far as the next test amends HEAD\n old_head1=$(git rev-parse --verify HEAD~0)\n-test_expect_success 'center alignment formatting with no padding. i18n.logOutputEncoding' '\n+test_expect_success ICONV 'center 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@@ -504,7 +504,7 @@ test_expect_success 'center alignment formatting with no padding. i18n.logOutput\n \ttest_cmp expected actual\n '\n \n-test_expect_success 'left/right alignment formatting with stealing' '\n+test_expect_success ICONV 'left/right alignment formatting with stealing' '\n \tgit commit --amend -m short --author \"long long long <long@me.com>\" &&\n \tgit log --pretty=\"tformat:%<(10,trunc)%s%>>(10,ltrunc)% an\" >actual &&\n \tcat <<-\\EOF >expected &&\n@@ -515,7 +515,7 @@ test_expect_success 'left/right alignment formatting with stealing' '\n \tEOF\n \ttest_cmp expected actual\n '\n-test_expect_success 'left/right alignment formatting with stealing. i18n.logOutputEncoding' '\n+test_expect_success ICONV 'left/right alignment formatting with stealing. i18n.logOutputEncoding' '\n \tgit -c i18n.logOutputEncoding=$test_encoding log --pretty=\"tformat:%<(10,trunc)%s%>>(10,ltrunc)% an\" >actual &&\n \tcat <<-\\EOF | iconv -f utf-8 -t $test_encoding >expected &&\n \tshort long  long long\n@@ -564,22 +564,38 @@ test_expect_success 'log decoration properly follows tag chain' '\n \tgit tag -d tag1 &&\n \tgit commit --amend -m shorter &&\n \tgit log --no-walk --tags --pretty=\"%H %d\" --decorate=full >actual &&\n-\tcat <<-EOF >expected &&\n-\t$head2  (tag: refs/tags/message-one)\n-\t$old_head1  (tag: refs/tags/message-two)\n-\t$head1  (tag: refs/tags/tag2)\n-\tEOF\n+\tif test_have_prereq ICONV\n+\tthen\n+\t\tcat <<-EOF >expected\n+\t\t$head2  (tag: refs/tags/message-one)\n+\t\t$old_head1  (tag: refs/tags/message-two)\n+\t\t$head1  (tag: refs/tags/tag2)\n+\t\tEOF\n+\telse\n+\t\tcat <<-EOF >expected\n+\t\t$head2  (tag: refs/tags/message-one)\n+\t\t$old_head1  (tag: refs/tags/tag2, tag: refs/tags/message-two)\n+\t\tEOF\n+\tfi &&\n \tsort -k3 actual >actual1 &&\n \ttest_cmp expected actual1\n '\n \n test_expect_success 'clean log decoration' '\n \tgit log --no-walk --tags --pretty=\"%H %D\" --decorate=full >actual &&\n-\tcat >expected <<-EOF &&\n-\t$head2 tag: refs/tags/message-one\n-\t$old_head1 tag: refs/tags/message-two\n-\t$head1 tag: refs/tags/tag2\n-\tEOF\n+\tif test_have_prereq ICONV\n+\tthen\n+\t\tcat <<-EOF >expected\n+\t\t$head2 tag: refs/tags/message-one\n+\t\t$old_head1 tag: refs/tags/message-two\n+\t\t$head1 tag: refs/tags/tag2\n+\t\tEOF\n+\telse\n+\t\tcat <<-EOF >expected\n+\t\t$head2 tag: refs/tags/message-one\n+\t\t$old_head1 tag: refs/tags/tag2, tag: refs/tags/message-two\n+\t\tEOF\n+\tfi &&\n \tsort -k3 actual >actual1 &&\n \ttest_cmp expected actual1\n '\ndiff --git a/t/t4210-log-i18n.sh b/t/t4210-log-i18n.sh\nindex 7120030b5c6..4a12b2b4979 100755\n--- a/t/t4210-log-i18n.sh\n+++ b/t/t4210-log-i18n.sh\n@@ -5,6 +5,12 @@ test_description='test log with i18n features'\n TEST_PASSES_SANITIZE_LEAK=true\n . ./lib-gettext.sh\n \n+if ! test_have_prereq ICONV\n+then\n+\tskip_all='skipping log i18n tests; iconv not available'\n+\ttest_done\n+fi\n+\n # two forms of é\n utf8_e=$(printf '\\303\\251')\n latin1_e=$(printf '\\351')\ndiff --git a/t/t4254-am-corrupt.sh b/t/t4254-am-corrupt.sh\nindex 661feb60709..cb03522d021 100755\n--- a/t/t4254-am-corrupt.sh\n+++ b/t/t4254-am-corrupt.sh\n@@ -5,6 +5,12 @@ test_description='git am with corrupt input'\n TEST_PASSES_SANITIZE_LEAK=true\n . ./test-lib.sh\n \n+if ! test_have_prereq ICONV\n+then\n+\tskip_all='skipping am encoding corruption tests; iconv not available'\n+\ttest_done\n+fi\n+\n make_mbox_with_nul () {\n \tspace=' '\n \tq_nul_in_subject=\ndiff --git a/t/t5100-mailinfo.sh b/t/t5100-mailinfo.sh\nindex 065156c1f39..23b2f218725 100755\n--- a/t/t5100-mailinfo.sh\n+++ b/t/t5100-mailinfo.sh\n@@ -28,7 +28,12 @@ check_mailinfo () {\n \n for mail in 00*\n do\n-\ttest_expect_success \"mailinfo $mail\" '\n+\tcase \"$mail\" in\n+\t0004)\n+\t\tprereq=ICONV;;\n+\tesac\n+\n+\ttest_expect_success $prereq \"mailinfo $mail\" '\n \t\tcheck_mailinfo \"$mail\" \"\" &&\n \t\tif test -f \"$DATA/msg$mail--scissors\"\n \t\tthen\n@@ -56,7 +61,12 @@ test_expect_success 'split box with rfc2047 samples' \\\n \n for mail in rfc2047/00*\n do\n-\ttest_expect_success \"mailinfo $mail\" '\n+\tcase \"$mail\" in\n+\trfc2047/0001)\n+\t\tprereq=ICONV;;\n+\tesac\n+\n+\ttest_expect_success $prereq \"mailinfo $mail\" '\n \t\tgit mailinfo -u \"$mail-msg\" \"$mail-patch\" <\"$mail\" >\"$mail-info\" &&\n \t\techo msg &&\n \t\ttest_cmp \"$DATA/empty\" \"$mail-msg\" &&\ndiff --git a/t/t5550-http-fetch-dumb.sh b/t/t5550-http-fetch-dumb.sh\nindex 58189c9f7dc..3c873de17ec 100755\n--- a/t/t5550-http-fetch-dumb.sh\n+++ b/t/t5550-http-fetch-dumb.sh\n@@ -344,12 +344,12 @@ test_expect_success 'git client shows text/plain with a charset' '\n \tgrep \"this is the error message\" stderr\n '\n \n-test_expect_success 'http error messages are reencoded' '\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 '\n \n-test_expect_success 'reencoding is robust to whitespace oddities' '\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 '\ndiff --git a/t/t6006-rev-list-format.sh b/t/t6006-rev-list-format.sh\nindex f1623b1c06d..2a01a62a2f3 100755\n--- a/t/t6006-rev-list-format.sh\n+++ b/t/t6006-rev-list-format.sh\n@@ -13,21 +13,41 @@ TEST_PASSES_SANITIZE_LEAK=true\n . \"$TEST_DIRECTORY\"/lib-terminal.sh\n \n test_tick\n-# Tested non-UTF-8 encoding\n-test_encoding=\"ISO8859-1\"\n-\n-# String \"added\" in German\n-# (translated with Google Translate),\n-# encoded in UTF-8, used as a commit log message below.\n-added_utf8_part=$(printf \"\\303\\274\")\n-added_utf8_part_iso88591=$(echo \"$added_utf8_part\" | iconv -f utf-8 -t $test_encoding)\n-added=$(printf \"added (hinzugef${added_utf8_part}gt) foo\")\n-added_iso88591=$(echo \"$added\" | iconv -f utf-8 -t $test_encoding)\n-# same but \"changed\"\n-changed_utf8_part=$(printf \"\\303\\244\")\n-changed_utf8_part_iso88591=$(echo \"$changed_utf8_part\" | iconv -f utf-8 -t $test_encoding)\n-changed=$(printf \"changed (ge${changed_utf8_part}ndert) foo\")\n-changed_iso88591=$(echo \"$changed\" | iconv -f utf-8 -t $test_encoding)\n+\n+if test_have_prereq ICONV\n+then\n+\t# Tested non-UTF-8 encoding\n+\ttest_encoding=\"ISO8859-1\"\n+\n+\t# String \"added\" in German\n+\t# (translated with Google Translate),\n+\t# encoded in UTF-8, used as a commit log message below.\n+\tadded_utf8_part=$(printf \"\\303\\274\")\n+\tadded_utf8_part_iso88591=$(echo \"$added_utf8_part\" | iconv -f utf-8 -t $test_encoding)\n+\tadded=$(printf \"added (hinzugef${added_utf8_part}gt) foo\")\n+\tadded_iso88591=$(echo \"$added\" | iconv -f utf-8 -t $test_encoding)\n+\t# same but \"changed\"\n+\tchanged_utf8_part=$(printf \"\\303\\244\")\n+\tchanged_utf8_part_iso88591=$(echo \"$changed_utf8_part\" | iconv -f utf-8 -t $test_encoding)\n+\tchanged=$(printf \"changed (ge${changed_utf8_part}ndert) foo\")\n+\tchanged_iso88591=$(echo \"$changed\" | iconv -f utf-8 -t $test_encoding)\n+else\n+\t# Tested non-UTF-8 encoding\n+\ttest_encoding=\"UTF-8\"\n+\n+\t# String \"added\" in German\n+\t# (translated with Google Translate),\n+\t# encoded in UTF-8, used as a commit log message below.\n+\tadded_utf8_part=\"u\"\n+\tadded_utf8_part_iso88591=\"u\"\n+\tadded=$(printf \"added (hinzugef${added_utf8_part}gt) foo\")\n+\tadded_iso88591=\"$added\"\n+\t# same but \"changed\"\n+\tchanged_utf8_part=\"a\"\n+\tchanged_utf8_part_iso88591=\"a\"\n+\tchanged=$(printf \"changed (ge${changed_utf8_part}ndert) foo\")\n+\tchanged_iso88591=\"$changed\"\n+fi\n \n # Count of char to truncate\n # Number is chosen so, that non-ACSII characters\n@@ -198,7 +218,7 @@ Thu, 7 Apr 2005 15:13:13 -0700\n 1112911993\n EOF\n \n-test_format encoding %e <<EOF\n+test_format ICONV encoding %e <<EOF\n commit $head2\n $test_encoding\n commit $head1\n@@ -374,7 +394,7 @@ test_expect_success 'setup complex body' '\n \thead3_short=$(git rev-parse --short $head3)\n '\n \n-test_format complex-encoding %e <<EOF\n+test_format ICONV complex-encoding %e <<EOF\n commit $head3\n $test_encoding\n commit $head2\ndiff --git a/t/t7102-reset.sh b/t/t7102-reset.sh\nindex 2add26d7684..e9a6cc72658 100755\n--- a/t/t7102-reset.sh\n+++ b/t/t7102-reset.sh\n@@ -13,21 +13,31 @@ export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME\n TEST_PASSES_SANITIZE_LEAK=true\n . ./test-lib.sh\n \n-commit_msg () {\n-\t# String \"modify 2nd file (changed)\" partly in German\n-\t# (translated with Google Translate),\n-\t# encoded in UTF-8, used as a commit log message below.\n-\tmsg=\"modify 2nd file (ge\\303\\244ndert)\\n\"\n-\tif test -n \"$1\"\n-\tthen\n-\t\tprintf \"$msg\" | iconv -f utf-8 -t \"$1\"\n-\telse\n-\t\tprintf \"$msg\"\n-\tfi\n-}\n-\n-# Tested non-UTF-8 encoding\n-test_encoding=\"ISO8859-1\"\n+if test_have_prereq ICONV\n+then\n+\tcommit_msg () {\n+\t\t# String \"modify 2nd file (changed)\" partly in German\n+\t\t# (translated with Google Translate),\n+\t\t# encoded in UTF-8, used as a commit log message below.\n+\t\tmsg=\"modify 2nd file (ge\\303\\244ndert)\\n\"\n+\t\tif test -n \"$1\"\n+\t\tthen\n+\t\t\tprintf \"$msg\" | iconv -f utf-8 -t \"$1\"\n+\t\telse\n+\t\t\tprintf \"$msg\"\n+\t\tfi\n+\t}\n+\n+\t# Tested non-UTF-8 encoding\n+\ttest_encoding=\"ISO8859-1\"\n+else\n+\tcommit_msg () {\n+\t\techo \"modify 2nd file (geandert)\"\n+\t}\n+\n+\t# Tested non-UTF-8 encoding\n+\ttest_encoding=\"UTF-8\"\n+fi\n \n test_expect_success 'creating initial files and commits' '\n \ttest_tick &&\ndiff --git a/t/t8005-blame-i18n.sh b/t/t8005-blame-i18n.sh\nindex 75da219ed1b..7a1f581c240 100755\n--- a/t/t8005-blame-i18n.sh\n+++ b/t/t8005-blame-i18n.sh\n@@ -3,6 +3,12 @@\n test_description='git blame encoding conversion'\n . ./test-lib.sh\n \n+if ! test_have_prereq ICONV\n+then\n+\tskip_all='skipping blame i18n tests; iconv not available'\n+\ttest_done\n+fi\n+\n . \"$TEST_DIRECTORY\"/t8005/utf8.txt\n . \"$TEST_DIRECTORY\"/t8005/euc-japan.txt\n . \"$TEST_DIRECTORY\"/t8005/sjis.txt\ndiff --git a/t/t9300-fast-import.sh b/t/t9300-fast-import.sh\nindex 3b3c371740a..6224f54d4d2 100755\n--- a/t/t9300-fast-import.sh\n+++ b/t/t9300-fast-import.sh\n@@ -3676,7 +3676,7 @@ test_expect_success !MINGW 'W: get-mark & empty orphan commit with erroneous thi\n ### series X (other new features)\n ###\n \n-test_expect_success 'X: handling encoding' '\n+test_expect_success ICONV 'X: handling encoding' '\n \ttest_tick &&\n \tcat >input <<-INPUT_END &&\n \tcommit refs/heads/encoding\ndiff --git a/t/t9350-fast-export.sh b/t/t9350-fast-export.sh\nindex 2bdc02b4599..9595dfef2ee 100755\n--- a/t/t9350-fast-export.sh\n+++ b/t/t9350-fast-export.sh\n@@ -125,7 +125,7 @@ test_expect_success 'fast-export --show-original-ids | git fast-import' '\n \ttest $MUSS = $(git rev-parse --verify refs/tags/muss)\n '\n \n-test_expect_success 'reencoding iso-8859-7' '\n+test_expect_success ICONV 'reencoding iso-8859-7' '\n \n \ttest_when_finished \"git reset --hard HEAD~1\" &&\n \ttest_config i18n.commitencoding iso-8859-7 &&\n@@ -421,7 +421,7 @@ M 100644 :1 there\n \n EOF\n \n-test_expect_success 'dropping tag of filtered out object' '\n+test_expect_success ICONV 'dropping tag of filtered out object' '\n (\n \tcd limit-by-paths &&\n \tgit fast-export --tag-of-filtered-object=drop mytag -- there > output &&\n@@ -438,7 +438,7 @@ msg\n \n EOF\n \n-test_expect_success 'rewriting tag of filtered out object' '\n+test_expect_success ICONV 'rewriting tag of filtered out object' '\n (\n \tcd limit-by-paths &&\n \tgit fast-export --tag-of-filtered-object=rewrite mytag -- there > output &&\n@@ -667,7 +667,7 @@ M 100644 :13 file\n \n EOF\n \n-test_expect_success 'avoid uninteresting refs' '\n+test_expect_success ICONV 'avoid uninteresting refs' '\n \t> tmp-marks &&\n \tgit fast-export --import-marks=tmp-marks \\\n \t\t--export-marks=tmp-marks main > /dev/null &&\n@@ -686,7 +686,7 @@ from :14\n \n EOF\n \n-test_expect_success 'refs are updated even if no commits need to be exported' '\n+test_expect_success ICONV 'refs are updated even if no commits need to be exported' '\n \t> tmp-marks &&\n \tgit fast-export --import-marks=tmp-marks \\\n \t\t--export-marks=tmp-marks main > /dev/null &&\ndiff --git a/t/test-lib.sh b/t/test-lib.sh\nindex 241198ba95f..a278181a056 100644\n--- a/t/test-lib.sh\n+++ b/t/test-lib.sh\n@@ -1743,6 +1743,7 @@ esac\n \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_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-- \n2.47.0.72.gef8ce8f3d4.dirty\n\n"},{"id":"505149","messageId":"2e2d208ef1b64e87795e91cf8cf1e4376067ccd4.1728992306.git.ps@pks.im","threadId":"62330","inReplyTo":"cover.1728992306.git.ps@pks.im","subject":"[PATCH v2 03/10] t/lib-gitweb: test against the build version of gitweb","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2024-10-15T11:45:14Z","receivedAt":"2024-10-15T11:45:18Z","isPatch":true,"sender":{"key":"ps@pks.im","avatar":"https://avatars.githubusercontent.com/u/4056630?v=4"},"body":"When testing gitweb we set up the CGI script as \"gitweb.perl\", which is\nthe source file of the build target \"gitweb.cgi\". This file doesn't have\na patched shebang and still contains `++REPLACEMENT++` markers, but\nthings generally work because we replace the configuration with our own\ntest configuration.\n\nBut this only works as long as \"$GIT_BUILD_DIR\" actually points to the\nsource tree, because \"gitweb.cgi\" and \"gitweb.perl\" happen to sit next\nto each other. This is not the case though once you have out-of-tree\nbuilds like with CMake, where the source and built versions live in\ndifferent directories. Consequently, \"$GIT_BUILD_DIR/gitweb/gitweb.perl\"\nwon't exist there.\n\nWhile we could ask build systems with out-of-tree builds to instead set\nup GITWEB_TEST_INSTALLED, which allows us to override the location of\nthe script, it goes against the spirit of this environment variable. We\n_don't_ want to test against an installed version, we want to use the\nversion we have just built.\n\nFix this by using \"gitweb.cgi\" instead. This means that you cannot run\ntest scripts without building that file, but in general we do expect\ndevelopers to build stuff before they test it anyway.\n\nSigned-off-by: Patrick Steinhardt <ps@pks.im>\n---\n t/lib-gitweb.sh | 4 ++--\n 1 file changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/t/lib-gitweb.sh b/t/lib-gitweb.sh\nindex 1f32ca66ea5..7f9808ec202 100644\n--- a/t/lib-gitweb.sh\n+++ b/t/lib-gitweb.sh\n@@ -48,8 +48,8 @@ EOF\n \t\ttest -f \"$SCRIPT_NAME\" ||\n \t\terror \"Cannot find gitweb at $GITWEB_TEST_INSTALLED.\"\n \t\tsay \"# Testing $SCRIPT_NAME\"\n-\telse # normal case, use source version of gitweb\n-\t\tSCRIPT_NAME=\"$GIT_BUILD_DIR/gitweb/gitweb.perl\"\n+\telse # normal case, use built version of gitweb\n+\t\tSCRIPT_NAME=\"$GIT_BUILD_DIR/gitweb/gitweb.cgi\"\n \tfi\n \texport SCRIPT_NAME\n }\n-- \n2.47.0.72.gef8ce8f3d4.dirty\n\n"},{"id":"505150","messageId":"cc94f6fa64805e0bc45fc18445c3e99d2f5ca9ed.1728992306.git.ps@pks.im","threadId":"62330","inReplyTo":"cover.1728992306.git.ps@pks.im","subject":"[PATCH v2 04/10] t/lib-gpg: fix setup of GNUPGHOME in MinGW","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2024-10-15T11:45:17Z","receivedAt":"2024-10-15T11:45:20Z","isPatch":true,"sender":{"key":"ps@pks.im","avatar":"https://avatars.githubusercontent.com/u/4056630?v=4"},"body":"In \"t/lib-gpg.sh\" we set up the \"GNUPGHOME\" environment variable to\npoint to a test-specific directory. This is done by using \"$PWD/gpghome\"\nas value, where \"$PWD\" is the current test's trash directory.\n\nThis is broken for MinGW though because \"$PWD\" will use Windows-style\npaths that contain drive letters. What we really want in this context is\na Unix-style path, which we can get by using `$(pwd)` instead. It is\nsomewhat puzzling that nobody ever hit this issue, but it may easily be\nthat nobody ever tests on Windows with GnuPG installed, which would make\nus skip those tests.\n\nAdapt the code accordingly to fix tests using this library.\n\nSigned-off-by: Patrick Steinhardt <ps@pks.im>\n---\n t/lib-gpg.sh | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/t/lib-gpg.sh b/t/lib-gpg.sh\nindex add11e88fc0..3845b6ac449 100644\n--- a/t/lib-gpg.sh\n+++ b/t/lib-gpg.sh\n@@ -6,7 +6,7 @@\n #   executed in an eval'ed subshell that changes the working directory to a\n #   temporary one.\n \n-GNUPGHOME=\"$PWD/gpghome\"\n+GNUPGHOME=\"$(pwd)/gpghome\"\n export GNUPGHOME\n \n test_lazy_prereq GPG '\n-- \n2.47.0.72.gef8ce8f3d4.dirty\n\n"},{"id":"505151","messageId":"58691dd652b23f2c630eba71bb9b93700ab66a09.1728992306.git.ps@pks.im","threadId":"62330","inReplyTo":"cover.1728992306.git.ps@pks.im","subject":"[PATCH v2 05/10] t1401: make invocation of tar(1) work with Win32-provided one","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2024-10-15T11:45:20Z","receivedAt":"2024-10-15T11:45:24Z","isPatch":true,"sender":{"key":"ps@pks.im","avatar":"https://avatars.githubusercontent.com/u/4056630?v=4"},"body":"Windows nowadays provides a tar(1) binary in \"C:\\Windows\\system32\". This\nversion of tar(1) doesn't seem to handle the case where directory paths\nend with a trailing forward slash. And as we do that in t1401 the result\nis that the test fails.\n\nDrop the trailing slash. Other tests that use tar(1) work alright, this\nis the only instance where it has been failing.\n\nSigned-off-by: Patrick Steinhardt <ps@pks.im>\n---\n t/t1401-symbolic-ref.sh | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/t/t1401-symbolic-ref.sh b/t/t1401-symbolic-ref.sh\nindex 5c60d6f812d..90af3f955c0 100755\n--- a/t/t1401-symbolic-ref.sh\n+++ b/t/t1401-symbolic-ref.sh\n@@ -16,7 +16,7 @@ reset_to_sane() {\n test_expect_success 'setup' '\n \tgit symbolic-ref HEAD refs/heads/foo &&\n \ttest_commit file &&\n-\t\"$TAR\" cf .git.tar .git/\n+\t\"$TAR\" cf .git.tar .git\n '\n \n test_expect_success 'symbolic-ref read/write roundtrip' '\n-- \n2.47.0.72.gef8ce8f3d4.dirty\n\n"},{"id":"505152","messageId":"1daadd82766a59577580dc386b91a942b0df6e15.1728992306.git.ps@pks.im","threadId":"62330","inReplyTo":"cover.1728992306.git.ps@pks.im","subject":"[PATCH v2 06/10] t3404: work around platform-specific behaviour on macOS 10.15","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2024-10-15T11:45:23Z","receivedAt":"2024-10-15T11:45:28Z","isPatch":true,"sender":{"key":"ps@pks.im","avatar":"https://avatars.githubusercontent.com/u/4056630?v=4"},"body":"Two of our tests in t3404 use indented HERE docs where leading tabs on\nsome of the lines are actually relevant. The tabs do get removed though,\nand we try to fix this up by using sed(1) to replace leading tabs in the\nactual output, as well. But macOS 10.15 uses an oldish version of sed(1)\nthat has BSD lineage, which does not understand \"\\t\", and thus we fail\nto strip those leading tabs and fail the test.\n\nAddress this issue by using `q_to_tab` such that we do not have to strip\nleading tabs from the actual output.\n\nSigned-off-by: Patrick Steinhardt <ps@pks.im>\n---\n t/t3404-rebase-interactive.sh | 26 ++++++++++++--------------\n 1 file changed, 12 insertions(+), 14 deletions(-)\n\ndiff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh\nindex f171af3061d..7ce75237803 100755\n--- a/t/t3404-rebase-interactive.sh\n+++ b/t/t3404-rebase-interactive.sh\n@@ -1917,18 +1917,17 @@ test_expect_success '--update-refs updates refs correctly' '\n \ttest_cmp_rev HEAD~1 refs/heads/third &&\n \ttest_cmp_rev HEAD refs/heads/no-conflict-branch &&\n \n-\tcat >expect <<-\\EOF &&\n+\tq_to_tab >expect <<-\\EOF &&\n \tSuccessfully rebased and updated refs/heads/update-refs.\n \tUpdated the following refs with --update-refs:\n-\t\trefs/heads/first\n-\t\trefs/heads/no-conflict-branch\n-\t\trefs/heads/second\n-\t\trefs/heads/third\n+\tQrefs/heads/first\n+\tQrefs/heads/no-conflict-branch\n+\tQrefs/heads/second\n+\tQrefs/heads/third\n \tEOF\n \n \t# Clear \"Rebasing (X/Y)\" progress lines and drop leading tabs.\n-\tsed -e \"s/Rebasing.*Successfully/Successfully/g\" -e \"s/^\\t//g\" \\\n-\t\t<err >err.trimmed &&\n+\tsed \"s/Rebasing.*Successfully/Successfully/g\" <err >err.trimmed &&\n \ttest_cmp expect err.trimmed\n '\n \n@@ -2178,19 +2177,18 @@ test_expect_success '--update-refs: check failed ref update' '\n \ttest_must_fail git rebase --continue 2>err &&\n \tgrep \"update_ref failed for ref '\\''refs/heads/second'\\''\" err &&\n \n-\tcat >expect <<-\\EOF &&\n+\tq_to_tab >expect <<-\\EOF &&\n \tUpdated the following refs with --update-refs:\n-\t\trefs/heads/first\n-\t\trefs/heads/no-conflict-branch\n-\t\trefs/heads/third\n+\tQrefs/heads/first\n+\tQrefs/heads/no-conflict-branch\n+\tQrefs/heads/third\n \tFailed to update the following refs with --update-refs:\n-\t\trefs/heads/second\n+\tQrefs/heads/second\n \tEOF\n \n \t# Clear \"Rebasing (X/Y)\" progress lines and drop leading tabs.\n \ttail -n 6 err >err.last &&\n-\tsed -e \"s/Rebasing.*Successfully/Successfully/g\" -e \"s/^\\t//g\" \\\n-\t\t<err.last >err.trimmed &&\n+\tsed \"s/Rebasing.*Successfully/Successfully/g\" <err.last >err.trimmed &&\n \ttest_cmp expect err.trimmed\n '\n \n-- \n2.47.0.72.gef8ce8f3d4.dirty\n\n"},{"id":"505153","messageId":"374f47bf3deb96843631882bd00e0f6f0fdc7287.1728992306.git.ps@pks.im","threadId":"62330","inReplyTo":"cover.1728992306.git.ps@pks.im","subject":"[PATCH v2 07/10] t5500, t5601: skip tests which exercise paths with '[::1]' on Cygwin","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2024-10-15T11:45:28Z","receivedAt":"2024-10-15T11:45:32Z","isPatch":true,"sender":{"key":"ps@pks.im","avatar":"https://avatars.githubusercontent.com/u/4056630?v=4"},"body":"Parsing repositories which contain '[::1]' is broken on Cygwin. It seems\nas if Cygwin is confusing those as drive letter prefixes or something\nlike this, but I couldn't deduce the actual root cause.\n\nMark those tests as broken for now.\n\nSigned-off-by: Patrick Steinhardt <ps@pks.im>\n---\n t/t5500-fetch-pack.sh | 14 ++++++++++----\n t/t5601-clone.sh      | 11 +++++++++--\n 2 files changed, 19 insertions(+), 6 deletions(-)\n\ndiff --git a/t/t5500-fetch-pack.sh b/t/t5500-fetch-pack.sh\nindex 605f17240c1..416522c86ad 100755\n--- a/t/t5500-fetch-pack.sh\n+++ b/t/t5500-fetch-pack.sh\n@@ -774,7 +774,7 @@ do\n \t# file with scheme\n \tfor p in file\n \tdo\n-\t\ttest_expect_success !MINGW \"fetch-pack --diag-url $p://$h/$r\" '\n+\t\ttest_expect_success !WINDOWS \"fetch-pack --diag-url $p://$h/$r\" '\n \t\t\tcheck_prot_path $p://$h/$r $p \"/$r\"\n \t\t'\n \t\ttest_expect_success MINGW \"fetch-pack --diag-url $p://$h/$r\" '\n@@ -784,7 +784,7 @@ do\n \t\t\tcheck_prot_path $p:///$r $p \"/$r\"\n \t\t'\n \t\t# No \"/~\" -> \"~\" conversion for file\n-\t\ttest_expect_success !MINGW \"fetch-pack --diag-url $p://$h/~$r\" '\n+\t\ttest_expect_success !WINDOWS \"fetch-pack --diag-url $p://$h/~$r\" '\n \t\t\tcheck_prot_path $p://$h/~$r $p \"/~$r\"\n \t\t'\n \t\ttest_expect_success MINGW \"fetch-pack --diag-url $p://$h/~$r\" '\n@@ -806,11 +806,17 @@ do\n \tp=ssh\n \tfor h in host [::1]\n \tdo\n-\t\ttest_expect_success \"fetch-pack --diag-url $h:$r\" '\n+\t\texpectation=\"success\"\n+\t\tif test_have_prereq CYGWIN && test \"$h\" = \"[::1]\"\n+\t\tthen\n+\t\t\texpectation=\"failure\"\n+\t\tfi\n+\n+\t\ttest_expect_$expectation \"fetch-pack --diag-url $h:$r\" '\n \t\t\tcheck_prot_host_port_path $h:$r $p \"$h\" NONE \"$r\"\n \t\t'\n \t\t# Do \"/~\" -> \"~\" conversion\n-\t\ttest_expect_success \"fetch-pack --diag-url $h:/~$r\" '\n+\t\ttest_expect_$expectation \"fetch-pack --diag-url $h:/~$r\" '\n \t\t\tcheck_prot_host_port_path $h:/~$r $p \"$h\" NONE \"~$r\"\n \t\t'\n \tdone\ndiff --git a/t/t5601-clone.sh b/t/t5601-clone.sh\nindex 5d7ea147f1a..9fe665eadfb 100755\n--- a/t/t5601-clone.sh\n+++ b/t/t5601-clone.sh\n@@ -530,10 +530,17 @@ do\n \t'\n done\n \n+# Parsing of paths that look like IPv6 addresses is broken on Cygwin.\n+expectation_for_ipv6_tests=success\n+if test_have_prereq CYGWIN\n+then\n+\texpectation_for_ipv6_tests=failure\n+fi\n+\n #ipv6\n for repo in rep rep/home/project 123\n do\n-\ttest_expect_success \"clone [::1]:$repo\" '\n+\ttest_expect_$expectation_for_ipv6_tests \"clone [::1]:$repo\" '\n \t\ttest_clone_url [::1]:$repo ::1 \"$repo\"\n \t'\n done\n@@ -542,7 +549,7 @@ test_expect_success \"clone host:/~repo\" '\n \ttest_clone_url host:/~repo host \"~repo\"\n '\n \n-test_expect_success \"clone [::1]:/~repo\" '\n+test_expect_$expectation_for_ipv6_tests \"clone [::1]:/~repo\" '\n \ttest_clone_url [::1]:/~repo ::1 \"~repo\"\n '\n \n-- \n2.47.0.72.gef8ce8f3d4.dirty\n\n"},{"id":"505154","messageId":"13c06a8129b13a672d3b8329db83db103607787b.1728992306.git.ps@pks.im","threadId":"62330","inReplyTo":"cover.1728992306.git.ps@pks.im","subject":"[PATCH v2 08/10] t7300: work around platform-specific behaviour with long paths on MinGW","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2024-10-15T11:45:31Z","receivedAt":"2024-10-15T11:45:34Z","isPatch":true,"sender":{"key":"ps@pks.im","avatar":"https://avatars.githubusercontent.com/u/4056630?v=4"},"body":"Windows by default has a restriction in place to only allow paths up to\n260 characters. This restriction can nowadays be lifted by setting a\nregistry key, but is still active by default.\n\nIn t7300 we have one test that exercises the behaviour of git-clean(1)\nwith such long paths. Interestingly enough, this test fails on my system\nthat uses Windows 10 with mingw-w64 installed via MSYS2: instead of\nobserving ENAMETOOLONG, we observe ENOENT. This behaviour is consistent\nacross multiple different environments I have tried.\n\nI cannot say why exactly we observe a different error here, but I would\nnot be surprised if this was either dependent on the Windows version,\nthe version of MinGW, the current working directory of Git or any kind\nof combination of these.\n\nWork around the issue by handling both errors.\n\nSigned-off-by: Patrick Steinhardt <ps@pks.im>\n---\n t/t7300-clean.sh | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/t/t7300-clean.sh b/t/t7300-clean.sh\nindex 0aae0dee670..12ab25296b0 100755\n--- a/t/t7300-clean.sh\n+++ b/t/t7300-clean.sh\n@@ -747,7 +747,7 @@ test_expect_success MINGW 'handle clean & core.longpaths = false nicely' '\n \ttest_must_fail git clean -xdf 2>.git/err &&\n \t# grepping for a strerror string is unportable but it is OK here with\n \t# MINGW prereq\n-\ttest_grep \"too long\" .git/err\n+\ttest_grep -e \"too long\" -e \"No such file or directory\" .git/err\n '\n \n test_expect_success 'clean untracked paths by pathspec' '\n-- \n2.47.0.72.gef8ce8f3d4.dirty\n\n"},{"id":"505155","messageId":"5fd78b6d535e8b151e6ff47716b83a97d8e03008.1728992306.git.ps@pks.im","threadId":"62330","inReplyTo":"cover.1728992306.git.ps@pks.im","subject":"[PATCH v2 09/10] builtin/credential-cache: fix missing parameter for stub function","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2024-10-15T11:45:34Z","receivedAt":"2024-10-15T11:45:38Z","isPatch":true,"sender":{"key":"ps@pks.im","avatar":"https://avatars.githubusercontent.com/u/4056630?v=4"},"body":"When not compiling the credential cache we may use a stub function for\n`cmd_credential_cache()`. With commit 9b1cb5070f (builtin: add a\nrepository parameter for builtin functions, 2024-09-13), we have added a\nnew parameter to all of those top-level `cmd_*()` functions, and did\nindeed adapt the non-stubbed-out `cmd_credential_cache()`. But we didn't\nadapt the stubbed-out variant, so the code does not compile.\n\nFix this by adding the missing parameter.\n\nSigned-off-by: Patrick Steinhardt <ps@pks.im>\n---\n builtin/credential-cache.c | 3 ++-\n 1 file changed, 2 insertions(+), 1 deletion(-)\n\ndiff --git a/builtin/credential-cache.c b/builtin/credential-cache.c\nindex 5de8b9123bf..c51f7fc2ade 100644\n--- a/builtin/credential-cache.c\n+++ b/builtin/credential-cache.c\n@@ -189,7 +189,8 @@ int cmd_credential_cache(int argc,\n \n #else\n \n-int cmd_credential_cache(int argc, const char **argv, const char *prefix)\n+int cmd_credential_cache(int argc, const char **argv, const char *prefix,\n+\t\t\t struct repository *repo UNUSED)\n {\n \tconst char * const usage[] = {\n \t\t\"git credential-cache [options] <action>\",\n-- \n2.47.0.72.gef8ce8f3d4.dirty\n\n"},{"id":"505156","messageId":"9963dc73988864b58e5d45e2c1039395f79fca57.1728992306.git.ps@pks.im","threadId":"62330","inReplyTo":"cover.1728992306.git.ps@pks.im","subject":"[PATCH v2 10/10] http: fix build error on FreeBSD","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2024-10-15T11:45:37Z","receivedAt":"2024-10-15T11:45:41Z","isPatch":true,"sender":{"key":"ps@pks.im","avatar":"https://avatars.githubusercontent.com/u/4056630?v=4"},"body":"The `result` parameter passed to `http_request_reauth()` may either\npoint to a `struct strbuf` or a `FILE *`, where the `target` parameter\ntells us which of either it actually is. To accommodate for both types\nthe pointer is a `void *`, which we then pass directly to functions\nwithout doing a cast.\n\nThis is fine on most platforms, but it breaks on FreeBSD because\n`fileno()` is implemented as a macro that tries to directly access the\n`FILE *` structure.\n\nFix this issue by storing the `FILE *` in a local variable before we\npass it on to other functions.\n\nSigned-off-by: Patrick Steinhardt <ps@pks.im>\n---\n http.c | 10 ++++++----\n 1 file changed, 6 insertions(+), 4 deletions(-)\n\ndiff --git a/http.c b/http.c\nindex d59e59f66b1..72973175a85 100644\n--- a/http.c\n+++ b/http.c\n@@ -2290,17 +2290,19 @@ static int http_request_reauth(const char *url,\n \t\tcase HTTP_REQUEST_STRBUF:\n \t\t\tstrbuf_reset(result);\n \t\t\tbreak;\n-\t\tcase HTTP_REQUEST_FILE:\n-\t\t\tif (fflush(result)) {\n+\t\tcase HTTP_REQUEST_FILE: {\n+\t\t\tFILE *f = result;\n+\t\t\tif (fflush(f)) {\n \t\t\t\terror_errno(\"unable to flush a file\");\n \t\t\t\treturn HTTP_START_FAILED;\n \t\t\t}\n-\t\t\trewind(result);\n-\t\t\tif (ftruncate(fileno(result), 0) < 0) {\n+\t\t\trewind(f);\n+\t\t\tif (ftruncate(fileno(f), 0) < 0) {\n \t\t\t\terror_errno(\"unable to truncate a file\");\n \t\t\t\treturn HTTP_START_FAILED;\n \t\t\t}\n \t\t\tbreak;\n+\t\t}\n \t\tdefault:\n \t\t\tBUG(\"Unknown http_request target\");\n \t\t}\n-- \n2.47.0.72.gef8ce8f3d4.dirty\n\n"},{"id":"505216","messageId":"Zw8AaF4VOaQO+P2M@nand.local","threadId":"62330","inReplyTo":"f6a8582c34a7b77aa3e2e45298208050333c384a.1728992306.git.ps@pks.im","subject":"Re: [PATCH v2 02/10] t/test-lib: wire up NO_ICONV prerequisite","fromName":"Taylor Blau","fromEmail":"me@ttaylorr.com","sentAt":"2024-10-15T23:53:12Z","receivedAt":"2024-10-15T23:53:20Z","isPatch":true,"sender":{"key":"me@ttaylorr.com","avatar":"https://avatars.githubusercontent.com/u/301000140?v=4"},"body":"On Tue, Oct 15, 2024 at 01:45:11PM +0200, Patrick Steinhardt wrote:\n> Further note that there are several \"!MINGW\" conditions in t4201, and\n> all of these fail due to iconv-related errors. This is quite likely a\n> leftover from times before dce7d29551 (msvc: support building Git using\n> MS Visual C++, 2019-06-25), which switched Windows-based builds over\n> from \"NO_ICONV=YesPlease\" to \"NEEDS_LIBICONV=YesPlease\". Consequently,\n> adapt those tests to also use the new ICONV prerequisite.\n\nThis appears to break CI on Windows when I merged this into 'jch':\n\n    https://github.com/ttaylorr/git/actions/runs/11355564982/job/31585450667\n\nI'm going to temporarily eject this from 'jch' and 'seen' until we can\nproperly deal with this.\n\nThanks,\nTaylor\n"},{"id":"505225","messageId":"Zw85joY3Hqzx23xc@pks.im","threadId":"62330","inReplyTo":"Zw8AaF4VOaQO+P2M@nand.local","subject":"Re: [PATCH v2 02/10] t/test-lib: wire up NO_ICONV prerequisite","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2024-10-16T03:57:10Z","receivedAt":"2024-10-16T03:57:18Z","isPatch":true,"sender":{"key":"ps@pks.im","avatar":"https://avatars.githubusercontent.com/u/4056630?v=4"},"body":"On Tue, Oct 15, 2024 at 07:53:12PM -0400, Taylor Blau wrote:\n> On Tue, Oct 15, 2024 at 01:45:11PM +0200, Patrick Steinhardt wrote:\n> > Further note that there are several \"!MINGW\" conditions in t4201, and\n> > all of these fail due to iconv-related errors. This is quite likely a\n> > leftover from times before dce7d29551 (msvc: support building Git using\n> > MS Visual C++, 2019-06-25), which switched Windows-based builds over\n> > from \"NO_ICONV=YesPlease\" to \"NEEDS_LIBICONV=YesPlease\". Consequently,\n> > adapt those tests to also use the new ICONV prerequisite.\n> \n> This appears to break CI on Windows when I merged this into 'jch':\n> \n>     https://github.com/ttaylorr/git/actions/runs/11355564982/job/31585450667\n> \n> I'm going to temporarily eject this from 'jch' and 'seen' until we can\n> properly deal with this.\n\nUgh, I'm looking forward to the Windows jobs for GitLab CI being merged\ndown to next so that I can finally see such regressions before they hit\nour trees. Anyway, thanks for the heads up, will have a look.\n\nPatrick\n"},{"id":"505227","messageId":"D4X00LKYK3TS.3DS67LXPIT9GU@jamesliu.io","threadId":"62330","inReplyTo":"58691dd652b23f2c630eba71bb9b93700ab66a09.1728992306.git.ps@pks.im","subject":"Re: [PATCH v2 05/10] t1401: make invocation of tar(1) work with Win32-provided one","fromName":"James Liu","fromEmail":"james@jamesliu.io","sentAt":"2024-10-16T05:58:29Z","receivedAt":"2024-10-16T05:58:33Z","isPatch":true,"sender":{"key":"james@jamesliu.io","avatar":"https://avatars.githubusercontent.com/u/4476568?v=4"},"body":"On Tue Oct 15, 2024 at 10:45 PM AEDT, Patrick Steinhardt wrote:\n> Windows nowadays provides a tar(1) binary in \"C:\\Windows\\system32\". This\n> version of tar(1) doesn't seem to handle the case where directory paths\n> end with a trailing forward slash. And as we do that in t1401 the result\n> is that the test fails.\n\nNative explorer.exe support for .tar (and a bunch of other archive\nformats) was added as part of KB5031455 [1] not too long ago. It just\nuses libarchive under the hood, and was a huge QoL improvement for me\nwhen I was running Windows full-time at home!\n\n[1] https://support.microsoft.com/en-us/topic/october-31-2023-kb5031455-os-builds-22621-2506-and-22631-2506-preview-6513c5ec-c5a2-4aaf-97f5-44c13d29e0d4\n"},{"id":"505228","messageId":"D4X017IIV17C.3G44QS1AYGJP@jamesliu.io","threadId":"62330","inReplyTo":"cc94f6fa64805e0bc45fc18445c3e99d2f5ca9ed.1728992306.git.ps@pks.im","subject":"Re: [PATCH v2 04/10] t/lib-gpg: fix setup of GNUPGHOME in MinGW","fromName":"James Liu","fromEmail":"james@jamesliu.io","sentAt":"2024-10-16T05:59:17Z","receivedAt":"2024-10-16T05:59:21Z","isPatch":true,"sender":{"key":"james@jamesliu.io","avatar":"https://avatars.githubusercontent.com/u/4476568?v=4"},"body":"On Tue Oct 15, 2024 at 10:45 PM AEDT, Patrick Steinhardt wrote:\n> In \"t/lib-gpg.sh\" we set up the \"GNUPGHOME\" environment variable to\n> point to a test-specific directory. This is done by using \"$PWD/gpghome\"\n> as value, where \"$PWD\" is the current test's trash directory.\n>\n> This is broken for MinGW though because \"$PWD\" will use Windows-style\n> paths that contain drive letters. What we really want in this context is\n> a Unix-style path, which we can get by using `$(pwd)` instead. It is\n> somewhat puzzling that nobody ever hit this issue, but it may easily be\n> that nobody ever tests on Windows with GnuPG installed, which would make\n> us skip those tests.\n\nThanks for the explanation! I didn't know \"$PWD\" and \"$(pwd)\" would\nbehave differently under MinGW.\n\n"},{"id":"505230","messageId":"D4X03LIWX1C0.1RGNH9U3SMF51@jamesliu.io","threadId":"62330","inReplyTo":"1daadd82766a59577580dc386b91a942b0df6e15.1728992306.git.ps@pks.im","subject":"Re: [PATCH v2 06/10] t3404: work around platform-specific behaviour on macOS 10.15","fromName":"James Liu","fromEmail":"james@jamesliu.io","sentAt":"2024-10-16T06:02:24Z","receivedAt":"2024-10-16T06:02:28Z","isPatch":true,"sender":{"key":"james@jamesliu.io","avatar":"https://avatars.githubusercontent.com/u/4476568?v=4"},"body":"On Tue Oct 15, 2024 at 10:45 PM AEDT, Patrick Steinhardt wrote:\n> Two of our tests in t3404 use indented HERE docs where leading tabs on\n> some of the lines are actually relevant. The tabs do get removed though,\n> and we try to fix this up by using sed(1) to replace leading tabs in the\n> actual output, as well. But macOS 10.15 uses an oldish version of sed(1)\n> that has BSD lineage, which does not understand \"\\t\", and thus we fail\n> to strip those leading tabs and fail the test.\n\nThe subtle differences in BSD and GNU-sed have caused me some headache\nin the past. I always work around the problem locally by installing the\n`gnu-sed` package via Homebrew, but it's better to change the test here.\n\n"},{"id":"505236","messageId":"D4X0SYYSUPWO.CFCUEN5B3MOQ@jamesliu.io","threadId":"62330","inReplyTo":"13c06a8129b13a672d3b8329db83db103607787b.1728992306.git.ps@pks.im","subject":"Re: [PATCH v2 08/10] t7300: work around platform-specific behaviour with long paths on MinGW","fromName":"James Liu","fromEmail":"james@jamesliu.io","sentAt":"2024-10-16T06:35:32Z","receivedAt":"2024-10-16T06:35:36Z","isPatch":true,"sender":{"key":"james@jamesliu.io","avatar":"https://avatars.githubusercontent.com/u/4476568?v=4"},"body":"On Tue Oct 15, 2024 at 10:45 PM AEDT, Patrick Steinhardt wrote:\n> Windows by default has a restriction in place to only allow paths up to\n> 260 characters. This restriction can nowadays be lifted by setting a\n> registry key, but is still active by default.\n>\n> In t7300 we have one test that exercises the behaviour of git-clean(1)\n> with such long paths. Interestingly enough, this test fails on my system\n> that uses Windows 10 with mingw-w64 installed via MSYS2: instead of\n> observing ENAMETOOLONG, we observe ENOENT. This behaviour is consistent\n> across multiple different environments I have tried.\n>\n> I cannot say why exactly we observe a different error here, but I would\n> not be surprised if this was either dependent on the Windows version,\n> the version of MinGW, the current working directory of Git or any kind\n> of combination of these.\n\nThat's very strange. I'll try it on my Windows 11 23H2 system to see if\nI can observe the same behaviour.\n\nI think it's fine to just catch both cases in the test anyway.\n\n"},{"id":"505239","messageId":"a514f5d14a7263750f1fa4bcc04e3daf2901c3eb.1729060405.git.ps@pks.im","threadId":"62330","inReplyTo":"cover.1729060405.git.ps@pks.im","subject":"[PATCH v3 01/10] t/test-lib: fix quoting of TEST_RESULTS_SAN_FILE","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2024-10-16T08:12:51Z","receivedAt":"2024-10-16T08:12:55Z","isPatch":true,"sender":{"key":"ps@pks.im","avatar":"https://avatars.githubusercontent.com/u/4056630?v=4"},"body":"When assembling our LSAN_OPTIONS that configure the leak sanitizer we\nend up prepending the string with various different colon-separated\noptions via calls to `prepend_var`. One of the settings we add is the\npath where the sanitizer should store logs, which can be an arbitrary\nfilesystem path.\n\nNaturally, filesystem paths may contain whitespace characters. And while\nit does seem as if we were quoting the value, we use escaped quotes and\nconsequently split up the value if it does contain spaces. This leads to\nthe following error in t0000 when having a value with whitespaces:\n\n    .../t/test-lib.sh: eval: line 64: unexpected EOF while looking for matching `\"'\n    ++ return 1\n    error: last command exited with $?=1\n    not ok 5 - subtest: 3 passing tests\n\nThe error itself is a bit puzzling at first. The basic problem is that\nthe code sees the leading escaped quote during eval, but because we\ntruncate everything after the space character it doesn't see the\ntrailing escaped quote and thus fails to parse the string.\n\nProperly quote the value to fix the issue while using single-quotes to\nquote the inner value passed to eval. The issue can be reproduced by\nt0000 with such a path that contains spaces.\n\nSigned-off-by: Patrick Steinhardt <ps@pks.im>\n---\n t/test-lib.sh | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/t/test-lib.sh b/t/test-lib.sh\nindex b1a8ee5c002..241198ba95f 100644\n--- a/t/test-lib.sh\n+++ b/t/test-lib.sh\n@@ -1572,7 +1572,7 @@ then\n \n \tprepend_var LSAN_OPTIONS : dedup_token_length=9999\n \tprepend_var LSAN_OPTIONS : log_exe_name=1\n-\tprepend_var LSAN_OPTIONS : log_path=\\\"$TEST_RESULTS_SAN_FILE\\\"\n+\tprepend_var LSAN_OPTIONS : log_path=\"'$TEST_RESULTS_SAN_FILE'\"\n \texport LSAN_OPTIONS\n \n elif test \"$GIT_TEST_PASSING_SANITIZE_LEAK\" = \"check\" ||\n-- \n2.47.0.72.gef8ce8f3d4.dirty\n\n"},{"id":"505240","messageId":"cover.1729060405.git.ps@pks.im","threadId":"62330","inReplyTo":"cover.1728906490.git.ps@pks.im","subject":"[PATCH v3 00/10] Platform compatibility fixes","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2024-10-16T08:12:48Z","receivedAt":"2024-10-16T08:12:55Z","isPatch":true,"sender":{"key":"ps@pks.im","avatar":"https://avatars.githubusercontent.com/u/4056630?v=4"},"body":"Hi,\n\nthis is the third version of this series that fixes various different\nissues on more or less esoteric platforms.\n\nThere's only a single change compared to v2, namely that I restore the\n`!MINGW` prerequisite in t4201. I've been a bit overeager to convert it\nto use `ICONV` as that platform is seemingly still broken here.\n\nI've kicked off another pipeline at GitHub [1] while the GitLab CI\nsupport for Windows hasn't yet landed to verify that things work as\nexpected now. Tests pass now.\n\nThanks!\n\n[1]: https://github.com/git/git/pull/1815\n\nPatrick\n\nPatrick Steinhardt (10):\n  t/test-lib: fix quoting of TEST_RESULTS_SAN_FILE\n  t/test-lib: wire up NO_ICONV prerequisite\n  t/lib-gitweb: test against the build version of gitweb\n  t/lib-gpg: fix setup of GNUPGHOME in MinGW\n  t1401: make invocation of tar(1) work with Win32-provided one\n  t3404: work around platform-specific behaviour on macOS 10.15\n  t5500, t5601: skip tests which exercise paths with '[::1]' on Cygwin\n  t7300: work around platform-specific behaviour with long paths on\n    MinGW\n  builtin/credential-cache: fix missing parameter for stub function\n  http: fix build error on FreeBSD\n\n Makefile                                     |   1 +\n builtin/credential-cache.c                   |   3 +-\n contrib/buildsystems/CMakeLists.txt          |   6 ++\n http.c                                       |  10 +-\n t/lib-gitweb.sh                              |   4 +-\n t/lib-gpg.sh                                 |   2 +-\n t/t0028-working-tree-encoding.sh             |   6 ++\n t/t1401-symbolic-ref.sh                      |   2 +-\n t/t2082-parallel-checkout-attributes.sh      |   2 +-\n t/t3404-rebase-interactive.sh                |  26 +++--\n t/t3434-rebase-i18n.sh                       |   6 ++\n t/t3900-i18n-commit.sh                       |   6 ++\n t/t3901-i18n-patch.sh                        |   6 ++\n t/t4041-diff-submodule-option.sh             |  16 ++-\n t/t4059-diff-submodule-not-initialized.sh    |  16 ++-\n t/t4060-diff-submodule-option-diff-format.sh |  17 ++--\n t/t4201-shortlog.sh                          |   8 +-\n t/t4205-log-pretty-formats.sh                | 102 +++++++++++--------\n t/t4210-log-i18n.sh                          |   6 ++\n t/t4254-am-corrupt.sh                        |   6 ++\n t/t5100-mailinfo.sh                          |  14 ++-\n t/t5500-fetch-pack.sh                        |  14 ++-\n t/t5550-http-fetch-dumb.sh                   |   4 +-\n t/t5601-clone.sh                             |  11 +-\n t/t6006-rev-list-format.sh                   |  54 ++++++----\n t/t7102-reset.sh                             |  40 +++++---\n t/t7300-clean.sh                             |   2 +-\n t/t8005-blame-i18n.sh                        |   6 ++\n t/t9300-fast-import.sh                       |   2 +-\n t/t9350-fast-export.sh                       |  10 +-\n t/test-lib.sh                                |   3 +-\n 31 files changed, 274 insertions(+), 137 deletions(-)\n\nRange-diff against v2:\n 1:  a514f5d14a7 =  1:  a514f5d14a7 t/test-lib: fix quoting of TEST_RESULTS_SAN_FILE\n 2:  f6a8582c34a !  2:  c046e5f03bf t/test-lib: wire up NO_ICONV prerequisite\n    @@ Commit message\n         assess whether the failure is expected or not. Most of the tests do\n         smell like the expected kind of failure though.\n     \n    -    Further note that there are several \"!MINGW\" conditions in t4201, and\n    -    all of these fail due to iconv-related errors. This is quite likely a\n    -    leftover from times before dce7d29551 (msvc: support building Git using\n    -    MS Visual C++, 2019-06-25), which switched Windows-based builds over\n    -    from \"NO_ICONV=YesPlease\" to \"NEEDS_LIBICONV=YesPlease\". Consequently,\n    -    adapt those tests to also use the new ICONV prerequisite.\n    -\n         Signed-off-by: Patrick Steinhardt <ps@pks.im>\n     \n      ## Makefile ##\n    @@ t/t4201-shortlog.sh: test_expect_success 'output from user-defined format is re-\n      '\n      \n     -test_expect_success !MINGW 'shortlog wrapping' '\n    -+test_expect_success ICONV 'shortlog wrapping' '\n    ++test_expect_success !MINGW,ICONV 'shortlog wrapping' '\n      \tcat >expect <<\\EOF &&\n      A U Thor (5):\n            Test\n    @@ t/t4201-shortlog.sh: EOF\n      '\n      \n     -test_expect_success !MINGW 'shortlog from non-git directory' '\n    -+test_expect_success ICONV 'shortlog from non-git directory' '\n    ++test_expect_success !MINGW,ICONV 'shortlog from non-git directory' '\n      \tgit log --no-expand-tabs HEAD >log &&\n      \tGIT_DIR=non-existing git shortlog -w <log >out &&\n      \ttest_cmp expect out\n      '\n      \n     -test_expect_success !MINGW 'shortlog can read --format=raw output' '\n    -+test_expect_success ICONV 'shortlog can read --format=raw output' '\n    ++test_expect_success !MINGW,ICONV 'shortlog can read --format=raw output' '\n      \tgit log --format=raw HEAD >log &&\n      \tGIT_DIR=non-existing git shortlog -w <log >out &&\n      \ttest_cmp expect out\n    @@ t/t4201-shortlog.sh: $DSCHO (2):\n      EOF\n      \n     -test_expect_success !MINGW 'shortlog encoding' '\n    -+test_expect_success ICONV 'shortlog encoding' '\n    ++test_expect_success !MINGW,ICONV 'shortlog encoding' '\n      \tgit reset --hard \"$commit\" &&\n      \tgit config --unset i18n.commitencoding &&\n      \techo 2 > a1 &&\n 3:  2e2d208ef1b =  3:  52d0b252a1c t/lib-gitweb: test against the build version of gitweb\n 4:  cc94f6fa648 =  4:  89957caf6ad t/lib-gpg: fix setup of GNUPGHOME in MinGW\n 5:  58691dd652b =  5:  df2fb1b9607 t1401: make invocation of tar(1) work with Win32-provided one\n 6:  1daadd82766 =  6:  29fffa5d86b t3404: work around platform-specific behaviour on macOS 10.15\n 7:  374f47bf3de =  7:  de4c0c786bd t5500, t5601: skip tests which exercise paths with '[::1]' on Cygwin\n 8:  13c06a8129b =  8:  ee67336621c t7300: work around platform-specific behaviour with long paths on MinGW\n 9:  5fd78b6d535 =  9:  aaa6b5a175d builtin/credential-cache: fix missing parameter for stub function\n10:  9963dc73988 = 10:  c22a94bab41 http: fix build error on FreeBSD\n-- \n2.47.0.72.gef8ce8f3d4.dirty\n\n"},{"id":"505241","messageId":"c046e5f03bf9e3eeda803133b88c3ae414fd0c69.1729060405.git.ps@pks.im","threadId":"62330","inReplyTo":"cover.1729060405.git.ps@pks.im","subject":"[PATCH v3 02/10] t/test-lib: wire up NO_ICONV prerequisite","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2024-10-16T08:12:53Z","receivedAt":"2024-10-16T08:12:57Z","isPatch":true,"sender":{"key":"ps@pks.im","avatar":"https://avatars.githubusercontent.com/u/4056630?v=4"},"body":"The iconv library is used by Git to reencode files, commit messages and\nother things. As such it is a rather integral part, but given that many\nplatforms nowadays use UTF-8 everywhere you can live without support for\nreencoding in many situations. It is thus optional to build Git with\niconv, and some of our platforms wired up in \"config.mak.uname\" disable\nit. But while we support building without it, running our test suite\nwith \"NO_ICONV=Yes\" causes many test failures.\n\nWire up a new test prerequisite ICONV that gets populated via our\nGIT-BUILD-OPTIONS. Annotate failing tests accordingly.\n\nNote that this commit does not do a deep dive into every single test to\nassess whether the failure is expected or not. Most of the tests do\nsmell like the expected kind of failure though.\n\nSigned-off-by: Patrick Steinhardt <ps@pks.im>\n---\n Makefile                                     |   1 +\n contrib/buildsystems/CMakeLists.txt          |   6 ++\n t/t0028-working-tree-encoding.sh             |   6 ++\n t/t2082-parallel-checkout-attributes.sh      |   2 +-\n t/t3434-rebase-i18n.sh                       |   6 ++\n t/t3900-i18n-commit.sh                       |   6 ++\n t/t3901-i18n-patch.sh                        |   6 ++\n t/t4041-diff-submodule-option.sh             |  16 ++-\n t/t4059-diff-submodule-not-initialized.sh    |  16 ++-\n t/t4060-diff-submodule-option-diff-format.sh |  17 ++--\n t/t4201-shortlog.sh                          |   8 +-\n t/t4205-log-pretty-formats.sh                | 102 +++++++++++--------\n t/t4210-log-i18n.sh                          |   6 ++\n t/t4254-am-corrupt.sh                        |   6 ++\n t/t5100-mailinfo.sh                          |  14 ++-\n t/t5550-http-fetch-dumb.sh                   |   4 +-\n t/t6006-rev-list-format.sh                   |  54 ++++++----\n t/t7102-reset.sh                             |  40 +++++---\n t/t8005-blame-i18n.sh                        |   6 ++\n t/t9300-fast-import.sh                       |   2 +-\n t/t9350-fast-export.sh                       |  10 +-\n t/test-lib.sh                                |   1 +\n 22 files changed, 229 insertions(+), 106 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex feeed6f9321..5db10347341 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -3171,6 +3171,7 @@ GIT-BUILD-OPTIONS: FORCE\n \t@echo PYTHON_PATH=\\''$(subst ','\\'',$(PYTHON_PATH_SQ))'\\' >>$@+\n \t@echo TAR=\\''$(subst ','\\'',$(subst ','\\'',$(TAR)))'\\' >>$@+\n \t@echo NO_CURL=\\''$(subst ','\\'',$(subst ','\\'',$(NO_CURL)))'\\' >>$@+\n+\t@echo NO_ICONV=\\''$(subst ','\\'',$(subst ','\\'',$(NO_ICONV)))'\\' >>$@+\n \t@echo NO_EXPAT=\\''$(subst ','\\'',$(subst ','\\'',$(NO_EXPAT)))'\\' >>$@+\n \t@echo USE_LIBPCRE2=\\''$(subst ','\\'',$(subst ','\\'',$(USE_LIBPCRE2)))'\\' >>$@+\n \t@echo NO_PERL=\\''$(subst ','\\'',$(subst ','\\'',$(NO_PERL)))'\\' >>$@+\ndiff --git a/contrib/buildsystems/CMakeLists.txt b/contrib/buildsystems/CMakeLists.txt\nindex 62af7b33d2f..1384c0eb6d3 100644\n--- a/contrib/buildsystems/CMakeLists.txt\n+++ b/contrib/buildsystems/CMakeLists.txt\n@@ -1109,6 +1109,7 @@ set(DIFF diff)\n set(PYTHON_PATH /usr/bin/python)\n set(TAR tar)\n set(NO_CURL )\n+set(NO_ICONV )\n set(NO_EXPAT )\n set(USE_LIBPCRE2 )\n set(NO_PERL )\n@@ -1122,6 +1123,10 @@ if(NOT CURL_FOUND)\n \tset(NO_CURL 1)\n endif()\n \n+if(NOT Iconv_FOUND)\n+\tSET(NO_ICONV 1)\n+endif()\n+\n if(NOT EXPAT_FOUND)\n \tset(NO_EXPAT 1)\n endif()\n@@ -1145,6 +1150,7 @@ file(APPEND ${CMAKE_BINARY_DIR}/GIT-BUILD-OPTIONS \"DIFF='${DIFF}'\\n\")\n file(APPEND ${CMAKE_BINARY_DIR}/GIT-BUILD-OPTIONS \"PYTHON_PATH='${PYTHON_PATH}'\\n\")\n file(APPEND ${CMAKE_BINARY_DIR}/GIT-BUILD-OPTIONS \"TAR='${TAR}'\\n\")\n file(APPEND ${CMAKE_BINARY_DIR}/GIT-BUILD-OPTIONS \"NO_CURL='${NO_CURL}'\\n\")\n+file(APPEND ${CMAKE_BINARY_DIR}/GIT-BUILD-OPTIONS \"NO_ICONV='${NO_ICONV}'\\n\")\n file(APPEND ${CMAKE_BINARY_DIR}/GIT-BUILD-OPTIONS \"NO_EXPAT='${NO_EXPAT}'\\n\")\n file(APPEND ${CMAKE_BINARY_DIR}/GIT-BUILD-OPTIONS \"NO_PERL='${NO_PERL}'\\n\")\n file(APPEND ${CMAKE_BINARY_DIR}/GIT-BUILD-OPTIONS \"NO_PTHREADS='${NO_PTHREADS}'\\n\")\ndiff --git a/t/t0028-working-tree-encoding.sh b/t/t0028-working-tree-encoding.sh\nindex ad151a34670..510da4ca12d 100755\n--- a/t/t0028-working-tree-encoding.sh\n+++ b/t/t0028-working-tree-encoding.sh\n@@ -12,6 +12,12 @@ TEST_CREATE_REPO_NO_TEMPLATE=1\n \n GIT_TRACE_WORKING_TREE_ENCODING=1 && export GIT_TRACE_WORKING_TREE_ENCODING\n \n+if ! test_have_prereq ICONV\n+then\n+\tskip_all='skipping working tree encoding tests; iconv not available'\n+\ttest_done\n+fi\n+\n test_expect_success 'setup test files' '\n \tgit config core.eol lf &&\n \ndiff --git a/t/t2082-parallel-checkout-attributes.sh b/t/t2082-parallel-checkout-attributes.sh\nindex aec55496eb1..a040aa54cee 100755\n--- a/t/t2082-parallel-checkout-attributes.sh\n+++ b/t/t2082-parallel-checkout-attributes.sh\n@@ -34,7 +34,7 @@ test_expect_success 'parallel-checkout with ident' '\n \t)\n '\n \n-test_expect_success 'parallel-checkout with re-encoding' '\n+test_expect_success ICONV 'parallel-checkout with re-encoding' '\n \tset_checkout_config 2 0 &&\n \tgit init encoding &&\n \t(\ndiff --git a/t/t3434-rebase-i18n.sh b/t/t3434-rebase-i18n.sh\nindex 26a48d6b103..97fc9a23f21 100755\n--- a/t/t3434-rebase-i18n.sh\n+++ b/t/t3434-rebase-i18n.sh\n@@ -20,6 +20,12 @@ export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME\n TEST_PASSES_SANITIZE_LEAK=true\n . ./test-lib.sh\n \n+if ! test_have_prereq ICONV\n+then\n+\tskip_all='skipping rebase i18n tests; iconv not available'\n+\ttest_done\n+fi\n+\n compare_msg () {\n \ticonv -f \"$2\" -t \"$3\" \"$TEST_DIRECTORY/t3434/$1\" >expect &&\n \tgit cat-file commit HEAD >raw &&\ndiff --git a/t/t3900-i18n-commit.sh b/t/t3900-i18n-commit.sh\nindex db7b403bc15..9d4b5ab1f95 100755\n--- a/t/t3900-i18n-commit.sh\n+++ b/t/t3900-i18n-commit.sh\n@@ -8,6 +8,12 @@ test_description='commit and log output encodings'\n TEST_PASSES_SANITIZE_LEAK=true\n . ./test-lib.sh\n \n+if ! test_have_prereq ICONV\n+then\n+\tskip_all='skipping commit i18n tests; iconv not available'\n+\ttest_done\n+fi\n+\n compare_with () {\n \tgit show -s $1 | sed -e '1,/^$/d' -e 's/^    //' >current &&\n \tcase \"$3\" in\ndiff --git a/t/t3901-i18n-patch.sh b/t/t3901-i18n-patch.sh\nindex 5f0b9afc3fa..e0659c92935 100755\n--- a/t/t3901-i18n-patch.sh\n+++ b/t/t3901-i18n-patch.sh\n@@ -11,6 +11,12 @@ export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME\n TEST_PASSES_SANITIZE_LEAK=true\n . ./test-lib.sh\n \n+if ! test_have_prereq ICONV\n+then\n+\tskip_all='skipping patch i18n tests; iconv not available'\n+\ttest_done\n+fi\n+\n check_encoding () {\n \t# Make sure characters are not corrupted\n \tcnt=\"$1\" header=\"$2\" i=1 j=0\ndiff --git a/t/t4041-diff-submodule-option.sh b/t/t4041-diff-submodule-option.sh\nindex 8fc40e75eb3..aa149e0085e 100755\n--- a/t/t4041-diff-submodule-option.sh\n+++ b/t/t4041-diff-submodule-option.sh\n@@ -15,12 +15,18 @@ export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME\n TEST_PASSES_SANITIZE_LEAK=true\n . ./test-lib.sh\n \n-# Tested non-UTF-8 encoding\n-test_encoding=\"ISO8859-1\"\n+# Test non-UTF-8 encoding in case iconv is available.\n+if test_have_prereq ICONV\n+then\n+\ttest_encoding=\"ISO8859-1\"\n+\t# String \"added\" in German (translated with Google Translate), encoded in UTF-8,\n+\t# used in sample commit log messages in add_file() function below.\n+\tadded=$(printf \"hinzugef\\303\\274gt\")\n+else\n+\ttest_encoding=\"UTF-8\"\n+\tadded=\"added\"\n+fi\n \n-# String \"added\" in German (translated with Google Translate), encoded in UTF-8,\n-# used in sample commit log messages in add_file() function below.\n-added=$(printf \"hinzugef\\303\\274gt\")\n add_file () {\n \t(\n \t\tcd \"$1\" &&\ndiff --git a/t/t4059-diff-submodule-not-initialized.sh b/t/t4059-diff-submodule-not-initialized.sh\nindex 668f5263038..28fd3cdb154 100755\n--- a/t/t4059-diff-submodule-not-initialized.sh\n+++ b/t/t4059-diff-submodule-not-initialized.sh\n@@ -12,12 +12,18 @@ initialized previously but the checkout has since been removed.\n TEST_PASSES_SANITIZE_LEAK=true\n . ./test-lib.sh\n \n-# Tested non-UTF-8 encoding\n-test_encoding=\"ISO8859-1\"\n \n-# String \"added\" in German (translated with Google Translate), encoded in UTF-8,\n-# used in sample commit log messages in add_file() function below.\n-added=$(printf \"hinzugef\\303\\274gt\")\n+# Test non-UTF-8 encoding in case iconv is available.\n+if test_have_prereq ICONV\n+then\n+\ttest_encoding=\"ISO8859-1\"\n+\t# String \"added\" in German (translated with Google Translate), encoded in UTF-8,\n+\t# used in sample commit log messages in add_file() function below.\n+\tadded=$(printf \"hinzugef\\303\\274gt\")\n+else\n+\ttest_encoding=\"UTF-8\"\n+\tadded=\"added\"\n+fi\n \n add_file () {\n \t(\ndiff --git a/t/t4060-diff-submodule-option-diff-format.sh b/t/t4060-diff-submodule-option-diff-format.sh\nindex 8ce67442d96..918334fa4c8 100755\n--- a/t/t4060-diff-submodule-option-diff-format.sh\n+++ b/t/t4060-diff-submodule-option-diff-format.sh\n@@ -13,12 +13,17 @@ This test tries to verify the sanity of --submodule=diff option of git diff.\n TEST_PASSES_SANITIZE_LEAK=true\n . ./test-lib.sh\n \n-# Tested non-UTF-8 encoding\n-test_encoding=\"ISO8859-1\"\n-\n-# String \"added\" in German (translated with Google Translate), encoded in UTF-8,\n-# used in sample commit log messages in add_file() function below.\n-added=$(printf \"hinzugef\\303\\274gt\")\n+# Test non-UTF-8 encoding in case iconv is available.\n+if test_have_prereq ICONV\n+then\n+\ttest_encoding=\"ISO8859-1\"\n+\t# String \"added\" in German (translated with Google Translate), encoded in UTF-8,\n+\t# used in sample commit log messages in add_file() function below.\n+\tadded=$(printf \"hinzugef\\303\\274gt\")\n+else\n+\ttest_encoding=\"UTF-8\"\n+\tadded=\"added\"\n+fi\n \n add_file () {\n \t(\ndiff --git a/t/t4201-shortlog.sh b/t/t4201-shortlog.sh\nindex c20c8857244..0ecb0597c9a 100755\n--- a/t/t4201-shortlog.sh\n+++ b/t/t4201-shortlog.sh\n@@ -105,7 +105,7 @@ test_expect_success 'output from user-defined format is re-wrapped' '\n \ttest_cmp expect log.predictable\n '\n \n-test_expect_success !MINGW 'shortlog wrapping' '\n+test_expect_success !MINGW,ICONV 'shortlog wrapping' '\n \tcat >expect <<\\EOF &&\n A U Thor (5):\n       Test\n@@ -126,13 +126,13 @@ EOF\n \ttest_cmp expect out\n '\n \n-test_expect_success !MINGW 'shortlog from non-git directory' '\n+test_expect_success !MINGW,ICONV 'shortlog from non-git directory' '\n \tgit log --no-expand-tabs HEAD >log &&\n \tGIT_DIR=non-existing git shortlog -w <log >out &&\n \ttest_cmp expect out\n '\n \n-test_expect_success !MINGW 'shortlog can read --format=raw output' '\n+test_expect_success !MINGW,ICONV 'shortlog can read --format=raw output' '\n \tgit log --format=raw HEAD >log &&\n \tGIT_DIR=non-existing git shortlog -w <log >out &&\n \ttest_cmp expect out\n@@ -182,7 +182,7 @@ $DSCHO (2):\n \n EOF\n \n-test_expect_success !MINGW 'shortlog encoding' '\n+test_expect_success !MINGW,ICONV 'shortlog encoding' '\n \tgit reset --hard \"$commit\" &&\n \tgit config --unset i18n.commitencoding &&\n \techo 2 > a1 &&\ndiff --git a/t/t4205-log-pretty-formats.sh b/t/t4205-log-pretty-formats.sh\nindex eb63ce011fa..dbbd6125510 100755\n--- a/t/t4205-log-pretty-formats.sh\n+++ b/t/t4205-log-pretty-formats.sh\n@@ -114,19 +114,19 @@ test_expect_success 'alias loop' '\n \ttest_must_fail git log --pretty=test-foo\n '\n \n-test_expect_success 'NUL separation' '\n+test_expect_success ICONV '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 'NUL termination' '\n+test_expect_success ICONV '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 'NUL separation with --stat' '\n+test_expect_success ICONV '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@@ -181,7 +181,7 @@ test_expect_success 'setup more commits' '\n \thead4=$(git rev-parse --verify --short HEAD~3)\n '\n \n-test_expect_success 'left alignment formatting' '\n+test_expect_success ICONV 'left alignment formatting' '\n \tgit log --pretty=\"tformat:%<(40)%s\" >actual &&\n \tqz_to_tab_space <<-EOF >expected &&\n \tmessage two                            Z\n@@ -192,7 +192,7 @@ test_expect_success 'left alignment formatting' '\n \ttest_cmp expected actual\n '\n \n-test_expect_success 'left alignment formatting. i18n.logOutputEncoding' '\n+test_expect_success ICONV 'left alignment formatting. i18n.logOutputEncoding' '\n \tgit -c i18n.logOutputEncoding=$test_encoding log --pretty=\"tformat:%<(40)%s\" >actual &&\n \tqz_to_tab_space <<-EOF | iconv -f utf-8 -t $test_encoding >expected &&\n \tmessage two                            Z\n@@ -203,7 +203,7 @@ test_expect_success 'left alignment formatting. i18n.logOutputEncoding' '\n \ttest_cmp expected actual\n '\n \n-test_expect_success 'left alignment formatting at the nth column' '\n+test_expect_success ICONV '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@@ -214,7 +214,7 @@ test_expect_success 'left alignment formatting at the nth column' '\n \ttest_cmp expected actual\n '\n \n-test_expect_success 'left alignment formatting at the nth column' '\n+test_expect_success ICONV '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@@ -225,7 +225,7 @@ test_expect_success 'left alignment formatting at the nth column' '\n \ttest_cmp expected actual\n '\n \n-test_expect_success 'left alignment formatting at the nth column. i18n.logOutputEncoding' '\n+test_expect_success ICONV 'left alignment formatting at the nth column. i18n.logOutputEncoding' '\n \tgit -c i18n.logOutputEncoding=$test_encoding log --pretty=\"tformat:%h %<|(40)%s\" >actual &&\n \tqz_to_tab_space <<-EOF | iconv -f utf-8 -t $test_encoding >expected &&\n \t$head1 message two                    Z\n@@ -236,7 +236,7 @@ test_expect_success 'left alignment formatting at the nth column. i18n.logOutput\n \ttest_cmp expected actual\n '\n \n-test_expect_success 'left alignment formatting with no padding' '\n+test_expect_success ICONV 'left alignment formatting with no padding' '\n \tgit log --pretty=\"tformat:%<(1)%s\" >actual &&\n \tcat <<-EOF >expected &&\n \tmessage two\n@@ -258,7 +258,7 @@ test_expect_success 'left alignment formatting with no padding. i18n.logOutputEn\n \ttest_cmp expected actual\n '\n \n-test_expect_success 'left alignment formatting with trunc' '\n+test_expect_success ICONV 'left alignment formatting with trunc' '\n \tgit log --pretty=\"tformat:%<(10,trunc)%s\" >actual &&\n \tqz_to_tab_space <<-\\EOF >expected &&\n \tmessage ..\n@@ -269,7 +269,7 @@ test_expect_success 'left alignment formatting with trunc' '\n \ttest_cmp expected actual\n '\n \n-test_expect_success 'left alignment formatting with trunc. i18n.logOutputEncoding' '\n+test_expect_success ICONV 'left alignment formatting with trunc. i18n.logOutputEncoding' '\n \tgit -c i18n.logOutputEncoding=$test_encoding log --pretty=\"tformat:%<(10,trunc)%s\" >actual &&\n \tqz_to_tab_space <<-\\EOF | iconv -f utf-8 -t $test_encoding >expected &&\n \tmessage ..\n@@ -280,7 +280,7 @@ test_expect_success 'left alignment formatting with trunc. i18n.logOutputEncodin\n \ttest_cmp expected actual\n '\n \n-test_expect_success 'left alignment formatting with ltrunc' '\n+test_expect_success ICONV '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@@ -291,7 +291,7 @@ test_expect_success 'left alignment formatting with ltrunc' '\n \ttest_cmp expected actual\n '\n \n-test_expect_success 'left alignment formatting with ltrunc. i18n.logOutputEncoding' '\n+test_expect_success ICONV 'left alignment formatting with ltrunc. i18n.logOutputEncoding' '\n \tgit -c i18n.logOutputEncoding=$test_encoding log --pretty=\"tformat:%<(10,ltrunc)%s\" >actual &&\n \tqz_to_tab_space <<-EOF | iconv -f utf-8 -t $test_encoding >expected &&\n \t..sage two\n@@ -302,7 +302,7 @@ test_expect_success 'left alignment formatting with ltrunc. i18n.logOutputEncodi\n \ttest_cmp expected actual\n '\n \n-test_expect_success 'left alignment formatting with mtrunc' '\n+test_expect_success ICONV '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@@ -313,7 +313,7 @@ test_expect_success 'left alignment formatting with mtrunc' '\n \ttest_cmp expected actual\n '\n \n-test_expect_success 'left alignment formatting with mtrunc. i18n.logOutputEncoding' '\n+test_expect_success ICONV 'left alignment formatting with mtrunc. i18n.logOutputEncoding' '\n \tgit -c i18n.logOutputEncoding=$test_encoding log --pretty=\"tformat:%<(10,mtrunc)%s\" >actual &&\n \tqz_to_tab_space <<-\\EOF | iconv -f utf-8 -t $test_encoding >expected &&\n \tmess.. two\n@@ -324,7 +324,7 @@ test_expect_success 'left alignment formatting with mtrunc. i18n.logOutputEncodi\n \ttest_cmp expected actual\n '\n \n-test_expect_success 'right alignment formatting' '\n+test_expect_success ICONV 'right alignment formatting' '\n \tgit log --pretty=\"tformat:%>(40)%s\" >actual &&\n \tqz_to_tab_space <<-EOF >expected &&\n \tZ                            message two\n@@ -335,7 +335,7 @@ test_expect_success 'right alignment formatting' '\n \ttest_cmp expected actual\n '\n \n-test_expect_success 'right alignment formatting. i18n.logOutputEncoding' '\n+test_expect_success ICONV 'right alignment formatting. i18n.logOutputEncoding' '\n \tgit -c i18n.logOutputEncoding=$test_encoding log --pretty=\"tformat:%>(40)%s\" >actual &&\n \tqz_to_tab_space <<-EOF | iconv -f utf-8 -t $test_encoding >expected &&\n \tZ                            message two\n@@ -346,7 +346,7 @@ test_expect_success 'right alignment formatting. i18n.logOutputEncoding' '\n \ttest_cmp expected actual\n '\n \n-test_expect_success 'right alignment formatting at the nth column' '\n+test_expect_success ICONV '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@@ -357,7 +357,7 @@ test_expect_success 'right alignment formatting at the nth column' '\n \ttest_cmp expected actual\n '\n \n-test_expect_success 'right alignment formatting at the nth column' '\n+test_expect_success ICONV '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@@ -368,7 +368,7 @@ test_expect_success 'right alignment formatting at the nth column' '\n \ttest_cmp expected actual\n '\n \n-test_expect_success 'right alignment formatting at the nth column. i18n.logOutputEncoding' '\n+test_expect_success ICONV 'right alignment formatting at the nth column. i18n.logOutputEncoding' '\n \tgit -c i18n.logOutputEncoding=$test_encoding log --pretty=\"tformat:%h %>|(40)%s\" >actual &&\n \tqz_to_tab_space <<-EOF | iconv -f utf-8 -t $test_encoding >expected &&\n \t$head1                      message two\n@@ -381,7 +381,7 @@ test_expect_success 'right alignment formatting at the nth column. i18n.logOutpu\n \n # Note: Space between 'message' and 'two' should be in the same column\n # as in previous test.\n-test_expect_success 'right alignment formatting at the nth column with --graph. i18n.logOutputEncoding' '\n+test_expect_success ICONV 'right alignment formatting at the nth column with --graph. i18n.logOutputEncoding' '\n \tgit -c i18n.logOutputEncoding=$test_encoding log --graph --pretty=\"tformat:%h %>|(40)%s\" >actual &&\n \ticonv -f utf-8 -t $test_encoding >expected <<-EOF &&\n \t* $head1                    message two\n@@ -392,7 +392,7 @@ test_expect_success 'right alignment formatting at the nth column with --graph.\n \ttest_cmp expected actual\n '\n \n-test_expect_success 'right alignment formatting with no padding' '\n+test_expect_success ICONV 'right alignment formatting with no padding' '\n \tgit log --pretty=\"tformat:%>(1)%s\" >actual &&\n \tcat <<-EOF >expected &&\n \tmessage two\n@@ -403,7 +403,7 @@ test_expect_success 'right alignment formatting with no padding' '\n \ttest_cmp expected actual\n '\n \n-test_expect_success 'right alignment formatting with no padding and with --graph' '\n+test_expect_success ICONV '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@@ -414,7 +414,7 @@ test_expect_success 'right alignment formatting with no padding and with --graph\n \ttest_cmp expected actual\n '\n \n-test_expect_success 'right alignment formatting with no padding. i18n.logOutputEncoding' '\n+test_expect_success ICONV 'right 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@@ -425,7 +425,7 @@ test_expect_success 'right alignment formatting with no padding. i18n.logOutputE\n \ttest_cmp expected actual\n '\n \n-test_expect_success 'center alignment formatting' '\n+test_expect_success ICONV 'center alignment formatting' '\n \tgit log --pretty=\"tformat:%><(40)%s\" >actual &&\n \tqz_to_tab_space <<-EOF >expected &&\n \tZ             message two              Z\n@@ -436,7 +436,7 @@ test_expect_success 'center alignment formatting' '\n \ttest_cmp expected actual\n '\n \n-test_expect_success 'center alignment formatting. i18n.logOutputEncoding' '\n+test_expect_success ICONV 'center alignment formatting. i18n.logOutputEncoding' '\n \tgit -c i18n.logOutputEncoding=$test_encoding log --pretty=\"tformat:%><(40)%s\" >actual &&\n \tqz_to_tab_space <<-EOF | iconv -f utf-8 -t $test_encoding >expected &&\n \tZ             message two              Z\n@@ -446,7 +446,7 @@ test_expect_success 'center alignment formatting. i18n.logOutputEncoding' '\n \tEOF\n \ttest_cmp expected actual\n '\n-test_expect_success 'center alignment formatting at the nth column' '\n+test_expect_success ICONV '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@@ -457,7 +457,7 @@ test_expect_success 'center alignment formatting at the nth column' '\n \ttest_cmp expected actual\n '\n \n-test_expect_success 'center alignment formatting at the nth column' '\n+test_expect_success ICONV '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@@ -468,7 +468,7 @@ test_expect_success 'center alignment formatting at the nth column' '\n \ttest_cmp expected actual\n '\n \n-test_expect_success 'center alignment formatting at the nth column. i18n.logOutputEncoding' '\n+test_expect_success ICONV 'center alignment formatting at the nth column. i18n.logOutputEncoding' '\n \tgit -c i18n.logOutputEncoding=$test_encoding log --pretty=\"tformat:%h %><|(40)%s\" >actual &&\n \tqz_to_tab_space <<-EOF | iconv -f utf-8 -t $test_encoding >expected &&\n \t$head1           message two          Z\n@@ -479,7 +479,7 @@ test_expect_success 'center alignment formatting at the nth column. i18n.logOutp\n \ttest_cmp expected actual\n '\n \n-test_expect_success 'center alignment formatting with no padding' '\n+test_expect_success ICONV 'center alignment formatting with no padding' '\n \tgit log --pretty=\"tformat:%><(1)%s\" >actual &&\n \tcat <<-EOF >expected &&\n \tmessage two\n@@ -493,7 +493,7 @@ test_expect_success 'center alignment formatting with no padding' '\n # save HEAD's SHA-1 digest (with no abbreviations) to use it below\n # as far as the next test amends HEAD\n old_head1=$(git rev-parse --verify HEAD~0)\n-test_expect_success 'center alignment formatting with no padding. i18n.logOutputEncoding' '\n+test_expect_success ICONV 'center 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@@ -504,7 +504,7 @@ test_expect_success 'center alignment formatting with no padding. i18n.logOutput\n \ttest_cmp expected actual\n '\n \n-test_expect_success 'left/right alignment formatting with stealing' '\n+test_expect_success ICONV 'left/right alignment formatting with stealing' '\n \tgit commit --amend -m short --author \"long long long <long@me.com>\" &&\n \tgit log --pretty=\"tformat:%<(10,trunc)%s%>>(10,ltrunc)% an\" >actual &&\n \tcat <<-\\EOF >expected &&\n@@ -515,7 +515,7 @@ test_expect_success 'left/right alignment formatting with stealing' '\n \tEOF\n \ttest_cmp expected actual\n '\n-test_expect_success 'left/right alignment formatting with stealing. i18n.logOutputEncoding' '\n+test_expect_success ICONV 'left/right alignment formatting with stealing. i18n.logOutputEncoding' '\n \tgit -c i18n.logOutputEncoding=$test_encoding log --pretty=\"tformat:%<(10,trunc)%s%>>(10,ltrunc)% an\" >actual &&\n \tcat <<-\\EOF | iconv -f utf-8 -t $test_encoding >expected &&\n \tshort long  long long\n@@ -564,22 +564,38 @@ test_expect_success 'log decoration properly follows tag chain' '\n \tgit tag -d tag1 &&\n \tgit commit --amend -m shorter &&\n \tgit log --no-walk --tags --pretty=\"%H %d\" --decorate=full >actual &&\n-\tcat <<-EOF >expected &&\n-\t$head2  (tag: refs/tags/message-one)\n-\t$old_head1  (tag: refs/tags/message-two)\n-\t$head1  (tag: refs/tags/tag2)\n-\tEOF\n+\tif test_have_prereq ICONV\n+\tthen\n+\t\tcat <<-EOF >expected\n+\t\t$head2  (tag: refs/tags/message-one)\n+\t\t$old_head1  (tag: refs/tags/message-two)\n+\t\t$head1  (tag: refs/tags/tag2)\n+\t\tEOF\n+\telse\n+\t\tcat <<-EOF >expected\n+\t\t$head2  (tag: refs/tags/message-one)\n+\t\t$old_head1  (tag: refs/tags/tag2, tag: refs/tags/message-two)\n+\t\tEOF\n+\tfi &&\n \tsort -k3 actual >actual1 &&\n \ttest_cmp expected actual1\n '\n \n test_expect_success 'clean log decoration' '\n \tgit log --no-walk --tags --pretty=\"%H %D\" --decorate=full >actual &&\n-\tcat >expected <<-EOF &&\n-\t$head2 tag: refs/tags/message-one\n-\t$old_head1 tag: refs/tags/message-two\n-\t$head1 tag: refs/tags/tag2\n-\tEOF\n+\tif test_have_prereq ICONV\n+\tthen\n+\t\tcat <<-EOF >expected\n+\t\t$head2 tag: refs/tags/message-one\n+\t\t$old_head1 tag: refs/tags/message-two\n+\t\t$head1 tag: refs/tags/tag2\n+\t\tEOF\n+\telse\n+\t\tcat <<-EOF >expected\n+\t\t$head2 tag: refs/tags/message-one\n+\t\t$old_head1 tag: refs/tags/tag2, tag: refs/tags/message-two\n+\t\tEOF\n+\tfi &&\n \tsort -k3 actual >actual1 &&\n \ttest_cmp expected actual1\n '\ndiff --git a/t/t4210-log-i18n.sh b/t/t4210-log-i18n.sh\nindex 7120030b5c6..4a12b2b4979 100755\n--- a/t/t4210-log-i18n.sh\n+++ b/t/t4210-log-i18n.sh\n@@ -5,6 +5,12 @@ test_description='test log with i18n features'\n TEST_PASSES_SANITIZE_LEAK=true\n . ./lib-gettext.sh\n \n+if ! test_have_prereq ICONV\n+then\n+\tskip_all='skipping log i18n tests; iconv not available'\n+\ttest_done\n+fi\n+\n # two forms of é\n utf8_e=$(printf '\\303\\251')\n latin1_e=$(printf '\\351')\ndiff --git a/t/t4254-am-corrupt.sh b/t/t4254-am-corrupt.sh\nindex 661feb60709..cb03522d021 100755\n--- a/t/t4254-am-corrupt.sh\n+++ b/t/t4254-am-corrupt.sh\n@@ -5,6 +5,12 @@ test_description='git am with corrupt input'\n TEST_PASSES_SANITIZE_LEAK=true\n . ./test-lib.sh\n \n+if ! test_have_prereq ICONV\n+then\n+\tskip_all='skipping am encoding corruption tests; iconv not available'\n+\ttest_done\n+fi\n+\n make_mbox_with_nul () {\n \tspace=' '\n \tq_nul_in_subject=\ndiff --git a/t/t5100-mailinfo.sh b/t/t5100-mailinfo.sh\nindex 065156c1f39..23b2f218725 100755\n--- a/t/t5100-mailinfo.sh\n+++ b/t/t5100-mailinfo.sh\n@@ -28,7 +28,12 @@ check_mailinfo () {\n \n for mail in 00*\n do\n-\ttest_expect_success \"mailinfo $mail\" '\n+\tcase \"$mail\" in\n+\t0004)\n+\t\tprereq=ICONV;;\n+\tesac\n+\n+\ttest_expect_success $prereq \"mailinfo $mail\" '\n \t\tcheck_mailinfo \"$mail\" \"\" &&\n \t\tif test -f \"$DATA/msg$mail--scissors\"\n \t\tthen\n@@ -56,7 +61,12 @@ test_expect_success 'split box with rfc2047 samples' \\\n \n for mail in rfc2047/00*\n do\n-\ttest_expect_success \"mailinfo $mail\" '\n+\tcase \"$mail\" in\n+\trfc2047/0001)\n+\t\tprereq=ICONV;;\n+\tesac\n+\n+\ttest_expect_success $prereq \"mailinfo $mail\" '\n \t\tgit mailinfo -u \"$mail-msg\" \"$mail-patch\" <\"$mail\" >\"$mail-info\" &&\n \t\techo msg &&\n \t\ttest_cmp \"$DATA/empty\" \"$mail-msg\" &&\ndiff --git a/t/t5550-http-fetch-dumb.sh b/t/t5550-http-fetch-dumb.sh\nindex 58189c9f7dc..3c873de17ec 100755\n--- a/t/t5550-http-fetch-dumb.sh\n+++ b/t/t5550-http-fetch-dumb.sh\n@@ -344,12 +344,12 @@ test_expect_success 'git client shows text/plain with a charset' '\n \tgrep \"this is the error message\" stderr\n '\n \n-test_expect_success 'http error messages are reencoded' '\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 '\n \n-test_expect_success 'reencoding is robust to whitespace oddities' '\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 '\ndiff --git a/t/t6006-rev-list-format.sh b/t/t6006-rev-list-format.sh\nindex f1623b1c06d..2a01a62a2f3 100755\n--- a/t/t6006-rev-list-format.sh\n+++ b/t/t6006-rev-list-format.sh\n@@ -13,21 +13,41 @@ TEST_PASSES_SANITIZE_LEAK=true\n . \"$TEST_DIRECTORY\"/lib-terminal.sh\n \n test_tick\n-# Tested non-UTF-8 encoding\n-test_encoding=\"ISO8859-1\"\n-\n-# String \"added\" in German\n-# (translated with Google Translate),\n-# encoded in UTF-8, used as a commit log message below.\n-added_utf8_part=$(printf \"\\303\\274\")\n-added_utf8_part_iso88591=$(echo \"$added_utf8_part\" | iconv -f utf-8 -t $test_encoding)\n-added=$(printf \"added (hinzugef${added_utf8_part}gt) foo\")\n-added_iso88591=$(echo \"$added\" | iconv -f utf-8 -t $test_encoding)\n-# same but \"changed\"\n-changed_utf8_part=$(printf \"\\303\\244\")\n-changed_utf8_part_iso88591=$(echo \"$changed_utf8_part\" | iconv -f utf-8 -t $test_encoding)\n-changed=$(printf \"changed (ge${changed_utf8_part}ndert) foo\")\n-changed_iso88591=$(echo \"$changed\" | iconv -f utf-8 -t $test_encoding)\n+\n+if test_have_prereq ICONV\n+then\n+\t# Tested non-UTF-8 encoding\n+\ttest_encoding=\"ISO8859-1\"\n+\n+\t# String \"added\" in German\n+\t# (translated with Google Translate),\n+\t# encoded in UTF-8, used as a commit log message below.\n+\tadded_utf8_part=$(printf \"\\303\\274\")\n+\tadded_utf8_part_iso88591=$(echo \"$added_utf8_part\" | iconv -f utf-8 -t $test_encoding)\n+\tadded=$(printf \"added (hinzugef${added_utf8_part}gt) foo\")\n+\tadded_iso88591=$(echo \"$added\" | iconv -f utf-8 -t $test_encoding)\n+\t# same but \"changed\"\n+\tchanged_utf8_part=$(printf \"\\303\\244\")\n+\tchanged_utf8_part_iso88591=$(echo \"$changed_utf8_part\" | iconv -f utf-8 -t $test_encoding)\n+\tchanged=$(printf \"changed (ge${changed_utf8_part}ndert) foo\")\n+\tchanged_iso88591=$(echo \"$changed\" | iconv -f utf-8 -t $test_encoding)\n+else\n+\t# Tested non-UTF-8 encoding\n+\ttest_encoding=\"UTF-8\"\n+\n+\t# String \"added\" in German\n+\t# (translated with Google Translate),\n+\t# encoded in UTF-8, used as a commit log message below.\n+\tadded_utf8_part=\"u\"\n+\tadded_utf8_part_iso88591=\"u\"\n+\tadded=$(printf \"added (hinzugef${added_utf8_part}gt) foo\")\n+\tadded_iso88591=\"$added\"\n+\t# same but \"changed\"\n+\tchanged_utf8_part=\"a\"\n+\tchanged_utf8_part_iso88591=\"a\"\n+\tchanged=$(printf \"changed (ge${changed_utf8_part}ndert) foo\")\n+\tchanged_iso88591=\"$changed\"\n+fi\n \n # Count of char to truncate\n # Number is chosen so, that non-ACSII characters\n@@ -198,7 +218,7 @@ Thu, 7 Apr 2005 15:13:13 -0700\n 1112911993\n EOF\n \n-test_format encoding %e <<EOF\n+test_format ICONV encoding %e <<EOF\n commit $head2\n $test_encoding\n commit $head1\n@@ -374,7 +394,7 @@ test_expect_success 'setup complex body' '\n \thead3_short=$(git rev-parse --short $head3)\n '\n \n-test_format complex-encoding %e <<EOF\n+test_format ICONV complex-encoding %e <<EOF\n commit $head3\n $test_encoding\n commit $head2\ndiff --git a/t/t7102-reset.sh b/t/t7102-reset.sh\nindex 2add26d7684..e9a6cc72658 100755\n--- a/t/t7102-reset.sh\n+++ b/t/t7102-reset.sh\n@@ -13,21 +13,31 @@ export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME\n TEST_PASSES_SANITIZE_LEAK=true\n . ./test-lib.sh\n \n-commit_msg () {\n-\t# String \"modify 2nd file (changed)\" partly in German\n-\t# (translated with Google Translate),\n-\t# encoded in UTF-8, used as a commit log message below.\n-\tmsg=\"modify 2nd file (ge\\303\\244ndert)\\n\"\n-\tif test -n \"$1\"\n-\tthen\n-\t\tprintf \"$msg\" | iconv -f utf-8 -t \"$1\"\n-\telse\n-\t\tprintf \"$msg\"\n-\tfi\n-}\n-\n-# Tested non-UTF-8 encoding\n-test_encoding=\"ISO8859-1\"\n+if test_have_prereq ICONV\n+then\n+\tcommit_msg () {\n+\t\t# String \"modify 2nd file (changed)\" partly in German\n+\t\t# (translated with Google Translate),\n+\t\t# encoded in UTF-8, used as a commit log message below.\n+\t\tmsg=\"modify 2nd file (ge\\303\\244ndert)\\n\"\n+\t\tif test -n \"$1\"\n+\t\tthen\n+\t\t\tprintf \"$msg\" | iconv -f utf-8 -t \"$1\"\n+\t\telse\n+\t\t\tprintf \"$msg\"\n+\t\tfi\n+\t}\n+\n+\t# Tested non-UTF-8 encoding\n+\ttest_encoding=\"ISO8859-1\"\n+else\n+\tcommit_msg () {\n+\t\techo \"modify 2nd file (geandert)\"\n+\t}\n+\n+\t# Tested non-UTF-8 encoding\n+\ttest_encoding=\"UTF-8\"\n+fi\n \n test_expect_success 'creating initial files and commits' '\n \ttest_tick &&\ndiff --git a/t/t8005-blame-i18n.sh b/t/t8005-blame-i18n.sh\nindex 75da219ed1b..7a1f581c240 100755\n--- a/t/t8005-blame-i18n.sh\n+++ b/t/t8005-blame-i18n.sh\n@@ -3,6 +3,12 @@\n test_description='git blame encoding conversion'\n . ./test-lib.sh\n \n+if ! test_have_prereq ICONV\n+then\n+\tskip_all='skipping blame i18n tests; iconv not available'\n+\ttest_done\n+fi\n+\n . \"$TEST_DIRECTORY\"/t8005/utf8.txt\n . \"$TEST_DIRECTORY\"/t8005/euc-japan.txt\n . \"$TEST_DIRECTORY\"/t8005/sjis.txt\ndiff --git a/t/t9300-fast-import.sh b/t/t9300-fast-import.sh\nindex 3b3c371740a..6224f54d4d2 100755\n--- a/t/t9300-fast-import.sh\n+++ b/t/t9300-fast-import.sh\n@@ -3676,7 +3676,7 @@ test_expect_success !MINGW 'W: get-mark & empty orphan commit with erroneous thi\n ### series X (other new features)\n ###\n \n-test_expect_success 'X: handling encoding' '\n+test_expect_success ICONV 'X: handling encoding' '\n \ttest_tick &&\n \tcat >input <<-INPUT_END &&\n \tcommit refs/heads/encoding\ndiff --git a/t/t9350-fast-export.sh b/t/t9350-fast-export.sh\nindex 2bdc02b4599..9595dfef2ee 100755\n--- a/t/t9350-fast-export.sh\n+++ b/t/t9350-fast-export.sh\n@@ -125,7 +125,7 @@ test_expect_success 'fast-export --show-original-ids | git fast-import' '\n \ttest $MUSS = $(git rev-parse --verify refs/tags/muss)\n '\n \n-test_expect_success 'reencoding iso-8859-7' '\n+test_expect_success ICONV 'reencoding iso-8859-7' '\n \n \ttest_when_finished \"git reset --hard HEAD~1\" &&\n \ttest_config i18n.commitencoding iso-8859-7 &&\n@@ -421,7 +421,7 @@ M 100644 :1 there\n \n EOF\n \n-test_expect_success 'dropping tag of filtered out object' '\n+test_expect_success ICONV 'dropping tag of filtered out object' '\n (\n \tcd limit-by-paths &&\n \tgit fast-export --tag-of-filtered-object=drop mytag -- there > output &&\n@@ -438,7 +438,7 @@ msg\n \n EOF\n \n-test_expect_success 'rewriting tag of filtered out object' '\n+test_expect_success ICONV 'rewriting tag of filtered out object' '\n (\n \tcd limit-by-paths &&\n \tgit fast-export --tag-of-filtered-object=rewrite mytag -- there > output &&\n@@ -667,7 +667,7 @@ M 100644 :13 file\n \n EOF\n \n-test_expect_success 'avoid uninteresting refs' '\n+test_expect_success ICONV 'avoid uninteresting refs' '\n \t> tmp-marks &&\n \tgit fast-export --import-marks=tmp-marks \\\n \t\t--export-marks=tmp-marks main > /dev/null &&\n@@ -686,7 +686,7 @@ from :14\n \n EOF\n \n-test_expect_success 'refs are updated even if no commits need to be exported' '\n+test_expect_success ICONV 'refs are updated even if no commits need to be exported' '\n \t> tmp-marks &&\n \tgit fast-export --import-marks=tmp-marks \\\n \t\t--export-marks=tmp-marks main > /dev/null &&\ndiff --git a/t/test-lib.sh b/t/test-lib.sh\nindex 241198ba95f..a278181a056 100644\n--- a/t/test-lib.sh\n+++ b/t/test-lib.sh\n@@ -1743,6 +1743,7 @@ esac\n \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_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-- \n2.47.0.72.gef8ce8f3d4.dirty\n\n"},{"id":"505242","messageId":"52d0b252a1ce73b0258301b836785b152c8ed066.1729060405.git.ps@pks.im","threadId":"62330","inReplyTo":"cover.1729060405.git.ps@pks.im","subject":"[PATCH v3 03/10] t/lib-gitweb: test against the build version of gitweb","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2024-10-16T08:12:56Z","receivedAt":"2024-10-16T08:13:00Z","isPatch":true,"sender":{"key":"ps@pks.im","avatar":"https://avatars.githubusercontent.com/u/4056630?v=4"},"body":"When testing gitweb we set up the CGI script as \"gitweb.perl\", which is\nthe source file of the build target \"gitweb.cgi\". This file doesn't have\na patched shebang and still contains `++REPLACEMENT++` markers, but\nthings generally work because we replace the configuration with our own\ntest configuration.\n\nBut this only works as long as \"$GIT_BUILD_DIR\" actually points to the\nsource tree, because \"gitweb.cgi\" and \"gitweb.perl\" happen to sit next\nto each other. This is not the case though once you have out-of-tree\nbuilds like with CMake, where the source and built versions live in\ndifferent directories. Consequently, \"$GIT_BUILD_DIR/gitweb/gitweb.perl\"\nwon't exist there.\n\nWhile we could ask build systems with out-of-tree builds to instead set\nup GITWEB_TEST_INSTALLED, which allows us to override the location of\nthe script, it goes against the spirit of this environment variable. We\n_don't_ want to test against an installed version, we want to use the\nversion we have just built.\n\nFix this by using \"gitweb.cgi\" instead. This means that you cannot run\ntest scripts without building that file, but in general we do expect\ndevelopers to build stuff before they test it anyway.\n\nSigned-off-by: Patrick Steinhardt <ps@pks.im>\n---\n t/lib-gitweb.sh | 4 ++--\n 1 file changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/t/lib-gitweb.sh b/t/lib-gitweb.sh\nindex 1f32ca66ea5..7f9808ec202 100644\n--- a/t/lib-gitweb.sh\n+++ b/t/lib-gitweb.sh\n@@ -48,8 +48,8 @@ EOF\n \t\ttest -f \"$SCRIPT_NAME\" ||\n \t\terror \"Cannot find gitweb at $GITWEB_TEST_INSTALLED.\"\n \t\tsay \"# Testing $SCRIPT_NAME\"\n-\telse # normal case, use source version of gitweb\n-\t\tSCRIPT_NAME=\"$GIT_BUILD_DIR/gitweb/gitweb.perl\"\n+\telse # normal case, use built version of gitweb\n+\t\tSCRIPT_NAME=\"$GIT_BUILD_DIR/gitweb/gitweb.cgi\"\n \tfi\n \texport SCRIPT_NAME\n }\n-- \n2.47.0.72.gef8ce8f3d4.dirty\n\n"},{"id":"505243","messageId":"89957caf6ad2f3af4b1c7298ba8253f07b9b0455.1729060405.git.ps@pks.im","threadId":"62330","inReplyTo":"cover.1729060405.git.ps@pks.im","subject":"[PATCH v3 04/10] t/lib-gpg: fix setup of GNUPGHOME in MinGW","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2024-10-16T08:12:59Z","receivedAt":"2024-10-16T08:13:05Z","isPatch":true,"sender":{"key":"ps@pks.im","avatar":"https://avatars.githubusercontent.com/u/4056630?v=4"},"body":"In \"t/lib-gpg.sh\" we set up the \"GNUPGHOME\" environment variable to\npoint to a test-specific directory. This is done by using \"$PWD/gpghome\"\nas value, where \"$PWD\" is the current test's trash directory.\n\nThis is broken for MinGW though because \"$PWD\" will use Windows-style\npaths that contain drive letters. What we really want in this context is\na Unix-style path, which we can get by using `$(pwd)` instead. It is\nsomewhat puzzling that nobody ever hit this issue, but it may easily be\nthat nobody ever tests on Windows with GnuPG installed, which would make\nus skip those tests.\n\nAdapt the code accordingly to fix tests using this library.\n\nSigned-off-by: Patrick Steinhardt <ps@pks.im>\n---\n t/lib-gpg.sh | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/t/lib-gpg.sh b/t/lib-gpg.sh\nindex add11e88fc0..3845b6ac449 100644\n--- a/t/lib-gpg.sh\n+++ b/t/lib-gpg.sh\n@@ -6,7 +6,7 @@\n #   executed in an eval'ed subshell that changes the working directory to a\n #   temporary one.\n \n-GNUPGHOME=\"$PWD/gpghome\"\n+GNUPGHOME=\"$(pwd)/gpghome\"\n export GNUPGHOME\n \n test_lazy_prereq GPG '\n-- \n2.47.0.72.gef8ce8f3d4.dirty\n\n"},{"id":"505244","messageId":"df2fb1b96076569ec020e67b488e01a3ae4394e1.1729060405.git.ps@pks.im","threadId":"62330","inReplyTo":"cover.1729060405.git.ps@pks.im","subject":"[PATCH v3 05/10] t1401: make invocation of tar(1) work with Win32-provided one","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2024-10-16T08:13:04Z","receivedAt":"2024-10-16T08:13:07Z","isPatch":true,"sender":{"key":"ps@pks.im","avatar":"https://avatars.githubusercontent.com/u/4056630?v=4"},"body":"Windows nowadays provides a tar(1) binary in \"C:\\Windows\\system32\". This\nversion of tar(1) doesn't seem to handle the case where directory paths\nend with a trailing forward slash. And as we do that in t1401 the result\nis that the test fails.\n\nDrop the trailing slash. Other tests that use tar(1) work alright, this\nis the only instance where it has been failing.\n\nSigned-off-by: Patrick Steinhardt <ps@pks.im>\n---\n t/t1401-symbolic-ref.sh | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/t/t1401-symbolic-ref.sh b/t/t1401-symbolic-ref.sh\nindex 5c60d6f812d..90af3f955c0 100755\n--- a/t/t1401-symbolic-ref.sh\n+++ b/t/t1401-symbolic-ref.sh\n@@ -16,7 +16,7 @@ reset_to_sane() {\n test_expect_success 'setup' '\n \tgit symbolic-ref HEAD refs/heads/foo &&\n \ttest_commit file &&\n-\t\"$TAR\" cf .git.tar .git/\n+\t\"$TAR\" cf .git.tar .git\n '\n \n test_expect_success 'symbolic-ref read/write roundtrip' '\n-- \n2.47.0.72.gef8ce8f3d4.dirty\n\n"},{"id":"505245","messageId":"29fffa5d86b5efef9647eade7c3fda4d6d6e6ddd.1729060405.git.ps@pks.im","threadId":"62330","inReplyTo":"cover.1729060405.git.ps@pks.im","subject":"[PATCH v3 06/10] t3404: work around platform-specific behaviour on macOS 10.15","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2024-10-16T08:13:07Z","receivedAt":"2024-10-16T08:13:10Z","isPatch":true,"sender":{"key":"ps@pks.im","avatar":"https://avatars.githubusercontent.com/u/4056630?v=4"},"body":"Two of our tests in t3404 use indented HERE docs where leading tabs on\nsome of the lines are actually relevant. The tabs do get removed though,\nand we try to fix this up by using sed(1) to replace leading tabs in the\nactual output, as well. But macOS 10.15 uses an oldish version of sed(1)\nthat has BSD lineage, which does not understand \"\\t\", and thus we fail\nto strip those leading tabs and fail the test.\n\nAddress this issue by using `q_to_tab` such that we do not have to strip\nleading tabs from the actual output.\n\nSigned-off-by: Patrick Steinhardt <ps@pks.im>\n---\n t/t3404-rebase-interactive.sh | 26 ++++++++++++--------------\n 1 file changed, 12 insertions(+), 14 deletions(-)\n\ndiff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh\nindex f171af3061d..7ce75237803 100755\n--- a/t/t3404-rebase-interactive.sh\n+++ b/t/t3404-rebase-interactive.sh\n@@ -1917,18 +1917,17 @@ test_expect_success '--update-refs updates refs correctly' '\n \ttest_cmp_rev HEAD~1 refs/heads/third &&\n \ttest_cmp_rev HEAD refs/heads/no-conflict-branch &&\n \n-\tcat >expect <<-\\EOF &&\n+\tq_to_tab >expect <<-\\EOF &&\n \tSuccessfully rebased and updated refs/heads/update-refs.\n \tUpdated the following refs with --update-refs:\n-\t\trefs/heads/first\n-\t\trefs/heads/no-conflict-branch\n-\t\trefs/heads/second\n-\t\trefs/heads/third\n+\tQrefs/heads/first\n+\tQrefs/heads/no-conflict-branch\n+\tQrefs/heads/second\n+\tQrefs/heads/third\n \tEOF\n \n \t# Clear \"Rebasing (X/Y)\" progress lines and drop leading tabs.\n-\tsed -e \"s/Rebasing.*Successfully/Successfully/g\" -e \"s/^\\t//g\" \\\n-\t\t<err >err.trimmed &&\n+\tsed \"s/Rebasing.*Successfully/Successfully/g\" <err >err.trimmed &&\n \ttest_cmp expect err.trimmed\n '\n \n@@ -2178,19 +2177,18 @@ test_expect_success '--update-refs: check failed ref update' '\n \ttest_must_fail git rebase --continue 2>err &&\n \tgrep \"update_ref failed for ref '\\''refs/heads/second'\\''\" err &&\n \n-\tcat >expect <<-\\EOF &&\n+\tq_to_tab >expect <<-\\EOF &&\n \tUpdated the following refs with --update-refs:\n-\t\trefs/heads/first\n-\t\trefs/heads/no-conflict-branch\n-\t\trefs/heads/third\n+\tQrefs/heads/first\n+\tQrefs/heads/no-conflict-branch\n+\tQrefs/heads/third\n \tFailed to update the following refs with --update-refs:\n-\t\trefs/heads/second\n+\tQrefs/heads/second\n \tEOF\n \n \t# Clear \"Rebasing (X/Y)\" progress lines and drop leading tabs.\n \ttail -n 6 err >err.last &&\n-\tsed -e \"s/Rebasing.*Successfully/Successfully/g\" -e \"s/^\\t//g\" \\\n-\t\t<err.last >err.trimmed &&\n+\tsed \"s/Rebasing.*Successfully/Successfully/g\" <err.last >err.trimmed &&\n \ttest_cmp expect err.trimmed\n '\n \n-- \n2.47.0.72.gef8ce8f3d4.dirty\n\n"},{"id":"505246","messageId":"de4c0c786bd0368a732fd7a7476f7f8506d4d46a.1729060405.git.ps@pks.im","threadId":"62330","inReplyTo":"cover.1729060405.git.ps@pks.im","subject":"[PATCH v3 07/10] t5500, t5601: skip tests which exercise paths with '[::1]' on Cygwin","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2024-10-16T08:13:10Z","receivedAt":"2024-10-16T08:13:13Z","isPatch":true,"sender":{"key":"ps@pks.im","avatar":"https://avatars.githubusercontent.com/u/4056630?v=4"},"body":"Parsing repositories which contain '[::1]' is broken on Cygwin. It seems\nas if Cygwin is confusing those as drive letter prefixes or something\nlike this, but I couldn't deduce the actual root cause.\n\nMark those tests as broken for now.\n\nSigned-off-by: Patrick Steinhardt <ps@pks.im>\n---\n t/t5500-fetch-pack.sh | 14 ++++++++++----\n t/t5601-clone.sh      | 11 +++++++++--\n 2 files changed, 19 insertions(+), 6 deletions(-)\n\ndiff --git a/t/t5500-fetch-pack.sh b/t/t5500-fetch-pack.sh\nindex 605f17240c1..416522c86ad 100755\n--- a/t/t5500-fetch-pack.sh\n+++ b/t/t5500-fetch-pack.sh\n@@ -774,7 +774,7 @@ do\n \t# file with scheme\n \tfor p in file\n \tdo\n-\t\ttest_expect_success !MINGW \"fetch-pack --diag-url $p://$h/$r\" '\n+\t\ttest_expect_success !WINDOWS \"fetch-pack --diag-url $p://$h/$r\" '\n \t\t\tcheck_prot_path $p://$h/$r $p \"/$r\"\n \t\t'\n \t\ttest_expect_success MINGW \"fetch-pack --diag-url $p://$h/$r\" '\n@@ -784,7 +784,7 @@ do\n \t\t\tcheck_prot_path $p:///$r $p \"/$r\"\n \t\t'\n \t\t# No \"/~\" -> \"~\" conversion for file\n-\t\ttest_expect_success !MINGW \"fetch-pack --diag-url $p://$h/~$r\" '\n+\t\ttest_expect_success !WINDOWS \"fetch-pack --diag-url $p://$h/~$r\" '\n \t\t\tcheck_prot_path $p://$h/~$r $p \"/~$r\"\n \t\t'\n \t\ttest_expect_success MINGW \"fetch-pack --diag-url $p://$h/~$r\" '\n@@ -806,11 +806,17 @@ do\n \tp=ssh\n \tfor h in host [::1]\n \tdo\n-\t\ttest_expect_success \"fetch-pack --diag-url $h:$r\" '\n+\t\texpectation=\"success\"\n+\t\tif test_have_prereq CYGWIN && test \"$h\" = \"[::1]\"\n+\t\tthen\n+\t\t\texpectation=\"failure\"\n+\t\tfi\n+\n+\t\ttest_expect_$expectation \"fetch-pack --diag-url $h:$r\" '\n \t\t\tcheck_prot_host_port_path $h:$r $p \"$h\" NONE \"$r\"\n \t\t'\n \t\t# Do \"/~\" -> \"~\" conversion\n-\t\ttest_expect_success \"fetch-pack --diag-url $h:/~$r\" '\n+\t\ttest_expect_$expectation \"fetch-pack --diag-url $h:/~$r\" '\n \t\t\tcheck_prot_host_port_path $h:/~$r $p \"$h\" NONE \"~$r\"\n \t\t'\n \tdone\ndiff --git a/t/t5601-clone.sh b/t/t5601-clone.sh\nindex 5d7ea147f1a..9fe665eadfb 100755\n--- a/t/t5601-clone.sh\n+++ b/t/t5601-clone.sh\n@@ -530,10 +530,17 @@ do\n \t'\n done\n \n+# Parsing of paths that look like IPv6 addresses is broken on Cygwin.\n+expectation_for_ipv6_tests=success\n+if test_have_prereq CYGWIN\n+then\n+\texpectation_for_ipv6_tests=failure\n+fi\n+\n #ipv6\n for repo in rep rep/home/project 123\n do\n-\ttest_expect_success \"clone [::1]:$repo\" '\n+\ttest_expect_$expectation_for_ipv6_tests \"clone [::1]:$repo\" '\n \t\ttest_clone_url [::1]:$repo ::1 \"$repo\"\n \t'\n done\n@@ -542,7 +549,7 @@ test_expect_success \"clone host:/~repo\" '\n \ttest_clone_url host:/~repo host \"~repo\"\n '\n \n-test_expect_success \"clone [::1]:/~repo\" '\n+test_expect_$expectation_for_ipv6_tests \"clone [::1]:/~repo\" '\n \ttest_clone_url [::1]:/~repo ::1 \"~repo\"\n '\n \n-- \n2.47.0.72.gef8ce8f3d4.dirty\n\n"},{"id":"505247","messageId":"ee67336621c9792352b71cecc72e97ad68e094d2.1729060405.git.ps@pks.im","threadId":"62330","inReplyTo":"cover.1729060405.git.ps@pks.im","subject":"[PATCH v3 08/10] t7300: work around platform-specific behaviour with long paths on MinGW","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2024-10-16T08:13:13Z","receivedAt":"2024-10-16T08:13:16Z","isPatch":true,"sender":{"key":"ps@pks.im","avatar":"https://avatars.githubusercontent.com/u/4056630?v=4"},"body":"Windows by default has a restriction in place to only allow paths up to\n260 characters. This restriction can nowadays be lifted by setting a\nregistry key, but is still active by default.\n\nIn t7300 we have one test that exercises the behaviour of git-clean(1)\nwith such long paths. Interestingly enough, this test fails on my system\nthat uses Windows 10 with mingw-w64 installed via MSYS2: instead of\nobserving ENAMETOOLONG, we observe ENOENT. This behaviour is consistent\nacross multiple different environments I have tried.\n\nI cannot say why exactly we observe a different error here, but I would\nnot be surprised if this was either dependent on the Windows version,\nthe version of MinGW, the current working directory of Git or any kind\nof combination of these.\n\nWork around the issue by handling both errors.\n\nSigned-off-by: Patrick Steinhardt <ps@pks.im>\n---\n t/t7300-clean.sh | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/t/t7300-clean.sh b/t/t7300-clean.sh\nindex 0aae0dee670..12ab25296b0 100755\n--- a/t/t7300-clean.sh\n+++ b/t/t7300-clean.sh\n@@ -747,7 +747,7 @@ test_expect_success MINGW 'handle clean & core.longpaths = false nicely' '\n \ttest_must_fail git clean -xdf 2>.git/err &&\n \t# grepping for a strerror string is unportable but it is OK here with\n \t# MINGW prereq\n-\ttest_grep \"too long\" .git/err\n+\ttest_grep -e \"too long\" -e \"No such file or directory\" .git/err\n '\n \n test_expect_success 'clean untracked paths by pathspec' '\n-- \n2.47.0.72.gef8ce8f3d4.dirty\n\n"},{"id":"505248","messageId":"aaa6b5a175d6dc91d68f76d4606c605ede9c4c88.1729060405.git.ps@pks.im","threadId":"62330","inReplyTo":"cover.1729060405.git.ps@pks.im","subject":"[PATCH v3 09/10] builtin/credential-cache: fix missing parameter for stub function","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2024-10-16T08:13:15Z","receivedAt":"2024-10-16T08:13:18Z","isPatch":true,"sender":{"key":"ps@pks.im","avatar":"https://avatars.githubusercontent.com/u/4056630?v=4"},"body":"When not compiling the credential cache we may use a stub function for\n`cmd_credential_cache()`. With commit 9b1cb5070f (builtin: add a\nrepository parameter for builtin functions, 2024-09-13), we have added a\nnew parameter to all of those top-level `cmd_*()` functions, and did\nindeed adapt the non-stubbed-out `cmd_credential_cache()`. But we didn't\nadapt the stubbed-out variant, so the code does not compile.\n\nFix this by adding the missing parameter.\n\nSigned-off-by: Patrick Steinhardt <ps@pks.im>\n---\n builtin/credential-cache.c | 3 ++-\n 1 file changed, 2 insertions(+), 1 deletion(-)\n\ndiff --git a/builtin/credential-cache.c b/builtin/credential-cache.c\nindex 5de8b9123bf..c51f7fc2ade 100644\n--- a/builtin/credential-cache.c\n+++ b/builtin/credential-cache.c\n@@ -189,7 +189,8 @@ int cmd_credential_cache(int argc,\n \n #else\n \n-int cmd_credential_cache(int argc, const char **argv, const char *prefix)\n+int cmd_credential_cache(int argc, const char **argv, const char *prefix,\n+\t\t\t struct repository *repo UNUSED)\n {\n \tconst char * const usage[] = {\n \t\t\"git credential-cache [options] <action>\",\n-- \n2.47.0.72.gef8ce8f3d4.dirty\n\n"},{"id":"505249","messageId":"c22a94bab4173cdf4d703b4b903b698223f7eae7.1729060405.git.ps@pks.im","threadId":"62330","inReplyTo":"cover.1729060405.git.ps@pks.im","subject":"[PATCH v3 10/10] http: fix build error on FreeBSD","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2024-10-16T08:13:18Z","receivedAt":"2024-10-16T08:13:23Z","isPatch":true,"sender":{"key":"ps@pks.im","avatar":"https://avatars.githubusercontent.com/u/4056630?v=4"},"body":"The `result` parameter passed to `http_request_reauth()` may either\npoint to a `struct strbuf` or a `FILE *`, where the `target` parameter\ntells us which of either it actually is. To accommodate for both types\nthe pointer is a `void *`, which we then pass directly to functions\nwithout doing a cast.\n\nThis is fine on most platforms, but it breaks on FreeBSD because\n`fileno()` is implemented as a macro that tries to directly access the\n`FILE *` structure.\n\nFix this issue by storing the `FILE *` in a local variable before we\npass it on to other functions.\n\nSigned-off-by: Patrick Steinhardt <ps@pks.im>\n---\n http.c | 10 ++++++----\n 1 file changed, 6 insertions(+), 4 deletions(-)\n\ndiff --git a/http.c b/http.c\nindex d59e59f66b1..72973175a85 100644\n--- a/http.c\n+++ b/http.c\n@@ -2290,17 +2290,19 @@ static int http_request_reauth(const char *url,\n \t\tcase HTTP_REQUEST_STRBUF:\n \t\t\tstrbuf_reset(result);\n \t\t\tbreak;\n-\t\tcase HTTP_REQUEST_FILE:\n-\t\t\tif (fflush(result)) {\n+\t\tcase HTTP_REQUEST_FILE: {\n+\t\t\tFILE *f = result;\n+\t\t\tif (fflush(f)) {\n \t\t\t\terror_errno(\"unable to flush a file\");\n \t\t\t\treturn HTTP_START_FAILED;\n \t\t\t}\n-\t\t\trewind(result);\n-\t\t\tif (ftruncate(fileno(result), 0) < 0) {\n+\t\t\trewind(f);\n+\t\t\tif (ftruncate(fileno(f), 0) < 0) {\n \t\t\t\terror_errno(\"unable to truncate a file\");\n \t\t\t\treturn HTTP_START_FAILED;\n \t\t\t}\n \t\t\tbreak;\n+\t\t}\n \t\tdefault:\n \t\t\tBUG(\"Unknown http_request target\");\n \t\t}\n-- \n2.47.0.72.gef8ce8f3d4.dirty\n\n"},{"id":"505252","messageId":"D4X36E9VX8YW.EGVWW94QFFCU@jamesliu.io","threadId":"62330","inReplyTo":"D4X0SYYSUPWO.CFCUEN5B3MOQ@jamesliu.io","subject":"Re: [PATCH v2 08/10] t7300: work around platform-specific behaviour with long paths on MinGW","fromName":"James Liu","fromEmail":"james@jamesliu.io","sentAt":"2024-10-16T08:27:06Z","receivedAt":"2024-10-16T08:27:11Z","isPatch":true,"sender":{"key":"james@jamesliu.io","avatar":"https://avatars.githubusercontent.com/u/4476568?v=4"},"body":"On Wed Oct 16, 2024 at 5:35 PM AEDT, James Liu wrote:\n> On Tue Oct 15, 2024 at 10:45 PM AEDT, Patrick Steinhardt wrote:\n> > Windows by default has a restriction in place to only allow paths up to\n> > 260 characters. This restriction can nowadays be lifted by setting a\n> > registry key, but is still active by default.\n> >\n> > In t7300 we have one test that exercises the behaviour of git-clean(1)\n> > with such long paths. Interestingly enough, this test fails on my system\n> > that uses Windows 10 with mingw-w64 installed via MSYS2: instead of\n> > observing ENAMETOOLONG, we observe ENOENT. This behaviour is consistent\n> > across multiple different environments I have tried.\n> >\n> > I cannot say why exactly we observe a different error here, but I would\n> > not be surprised if this was either dependent on the Windows version,\n> > the version of MinGW, the current working directory of Git or any kind\n> > of combination of these.\n>\n> That's very strange. I'll try it on my Windows 11 23H2 system to see if\n> I can observe the same behaviour.\n\nHmm maybe not. MSYS2 on ARM64 isn't fully baked, and I don't have an x86\nWindows machine handy.\n\n"},{"id":"505306","messageId":"ZxApLn9Qf4hdAlBL@nand.local","threadId":"62330","inReplyTo":"Zw85joY3Hqzx23xc@pks.im","subject":"Re: [PATCH v2 02/10] t/test-lib: wire up NO_ICONV prerequisite","fromName":"Taylor Blau","fromEmail":"me@ttaylorr.com","sentAt":"2024-10-16T20:59:26Z","receivedAt":"2024-10-16T20:59:30Z","isPatch":true,"sender":{"key":"me@ttaylorr.com","avatar":"https://avatars.githubusercontent.com/u/301000140?v=4"},"body":"On Wed, Oct 16, 2024 at 05:57:10AM +0200, Patrick Steinhardt wrote:\n> On Tue, Oct 15, 2024 at 07:53:12PM -0400, Taylor Blau wrote:\n> > On Tue, Oct 15, 2024 at 01:45:11PM +0200, Patrick Steinhardt wrote:\n> > > Further note that there are several \"!MINGW\" conditions in t4201, and\n> > > all of these fail due to iconv-related errors. This is quite likely a\n> > > leftover from times before dce7d29551 (msvc: support building Git using\n> > > MS Visual C++, 2019-06-25), which switched Windows-based builds over\n> > > from \"NO_ICONV=YesPlease\" to \"NEEDS_LIBICONV=YesPlease\". Consequently,\n> > > adapt those tests to also use the new ICONV prerequisite.\n> >\n> > This appears to break CI on Windows when I merged this into 'jch':\n> >\n> >     https://github.com/ttaylorr/git/actions/runs/11355564982/job/31585450667\n> >\n> > I'm going to temporarily eject this from 'jch' and 'seen' until we can\n> > properly deal with this.\n>\n> Ugh, I'm looking forward to the Windows jobs for GitLab CI being merged\n> down to next so that I can finally see such regressions before they hit\n> our trees. Anyway, thanks for the heads up, will have a look.\n\nIt's OK. Ejecting a topic out of 'seen' is relatively easy as it\nrequires the following (after removing the line out of Meta/redo-seen.sh):\n\n    git checkout -B seen jch\n    sh Meta/redo-seen.sh\n\nI was mostly confused why my build of 'seen' passed 'make test' locally,\nbut failed CI when pushed to GitHub. Of course, I'm not testing on a\nWindows machine, and you didn't have easy access to Windows CI runs on\nGitLab (for now), so the result makes sense.\n\nThanks again for working on it.\n\nThanks,\nTaylor\n"},{"id":"505308","messageId":"ZxAqA+iyz8EIOeNC@nand.local","threadId":"62330","inReplyTo":"ZxApLn9Qf4hdAlBL@nand.local","subject":"Re: [PATCH v2 02/10] t/test-lib: wire up NO_ICONV prerequisite","fromName":"Taylor Blau","fromEmail":"me@ttaylorr.com","sentAt":"2024-10-16T21:02:59Z","receivedAt":"2024-10-16T21:03:03Z","isPatch":true,"sender":{"key":"me@ttaylorr.com","avatar":"https://avatars.githubusercontent.com/u/301000140?v=4"},"body":"On Wed, Oct 16, 2024 at 04:59:26PM -0400, Taylor Blau wrote:\n> On Wed, Oct 16, 2024 at 05:57:10AM +0200, Patrick Steinhardt wrote:\n> > On Tue, Oct 15, 2024 at 07:53:12PM -0400, Taylor Blau wrote:\n> > > On Tue, Oct 15, 2024 at 01:45:11PM +0200, Patrick Steinhardt wrote:\n> > > > Further note that there are several \"!MINGW\" conditions in t4201, and\n> > > > all of these fail due to iconv-related errors. This is quite likely a\n> > > > leftover from times before dce7d29551 (msvc: support building Git using\n> > > > MS Visual C++, 2019-06-25), which switched Windows-based builds over\n> > > > from \"NO_ICONV=YesPlease\" to \"NEEDS_LIBICONV=YesPlease\". Consequently,\n> > > > adapt those tests to also use the new ICONV prerequisite.\n> > >\n> > > This appears to break CI on Windows when I merged this into 'jch':\n> > >\n> > >     https://github.com/ttaylorr/git/actions/runs/11355564982/job/31585450667\n> > >\n> > > I'm going to temporarily eject this from 'jch' and 'seen' until we can\n> > > properly deal with this.\n> >\n> > Ugh, I'm looking forward to the Windows jobs for GitLab CI being merged\n> > down to next so that I can finally see such regressions before they hit\n> > our trees. Anyway, thanks for the heads up, will have a look.\n>\n> It's OK. Ejecting a topic out of 'seen' is relatively easy as it\n> requires the following (after removing the line out of Meta/redo-seen.sh):\n>\n>     git checkout -B seen jch\n>     sh Meta/redo-seen.sh\n>\n> I was mostly confused why my build of 'seen' passed 'make test' locally,\n> but failed CI when pushed to GitHub. Of course, I'm not testing on a\n> Windows machine, and you didn't have easy access to Windows CI runs on\n> GitLab (for now), so the result makes sense.\n\nSpeaking of... I have 'ps/ci-gitlab-windows' tagged for 'next' in the\nnext integration round. There is some duplication of patches between\nthat topic and this one (as well as ps/build).\n\nHow do you want me to handle the dependency?\n\nThanks,\nTaylor\n"},{"id":"505320","messageId":"ZxBj-VEU6M2TVL2W@tapette.crustytoothpaste.net","threadId":"62330","inReplyTo":"c046e5f03bf9e3eeda803133b88c3ae414fd0c69.1729060405.git.ps@pks.im","subject":"Re: [PATCH v3 02/10] t/test-lib: wire up NO_ICONV prerequisite","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2024-10-17T01:10:17Z","receivedAt":"2024-10-17T01:10:28Z","isPatch":true,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"On 2024-10-16 at 08:12:53, Patrick Steinhardt wrote:\n> The iconv library is used by Git to reencode files, commit messages and\n> other things. As such it is a rather integral part, but given that many\n> platforms nowadays use UTF-8 everywhere you can live without support for\n> reencoding in many situations. It is thus optional to build Git with\n> iconv, and some of our platforms wired up in \"config.mak.uname\" disable\n> it. But while we support building without it, running our test suite\n> with \"NO_ICONV=Yes\" causes many test failures.\n> \n> Wire up a new test prerequisite ICONV that gets populated via our\n> GIT-BUILD-OPTIONS. Annotate failing tests accordingly.\n\nI don't really have a strong opinion on this patch, but this has been a\npart of POSIX since the 2001 revision, so everyone except Windows should\nhave it by default (and Git for Windows ships with their own version).\nPerhaps if people are not seeing the tests fail, that's because everyone\nis building with iconv enabled?\n\nI will also add that as much as we might like people to be using UTF-8\neverywhere (and to be clear, I very much would), many repositories still\nhave commits encoded in older ways (such as the Linux kernel) and there\nare unfortunately many people using working-tree-encoding to convert to\nUTF-16LE-BOM for compatibility with legacy Windows software, so in\ngeneral, only users in highly restricted Unix-only environments would be\nable to confidently run without support for more encodings than UTF-8.\n\nI think this patch is fine for now, but given what I mentioned above,\nmaybe we want to add a weather balloon in a future series to see if\nanyone is compiling with NO_ICONV.  After all, if everybody has easy\naccess to iconv(3), then we might be able to drop support for NO_ICONV\nand the work maintaining it entails without negatively impacting anyone.\n-- \nbrian m. carlson (they/them or he/him)\nToronto, Ontario, CA\n"},{"id":"505325","messageId":"ZxCMj2C0G_zkWuON@pks.im","threadId":"62330","inReplyTo":"ZxBj-VEU6M2TVL2W@tapette.crustytoothpaste.net","subject":"Re: [PATCH v3 02/10] t/test-lib: wire up NO_ICONV prerequisite","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2024-10-17T04:03:32Z","receivedAt":"2024-10-17T04:03:39Z","isPatch":true,"sender":{"key":"ps@pks.im","avatar":"https://avatars.githubusercontent.com/u/4056630?v=4"},"body":"On Thu, Oct 17, 2024 at 01:10:17AM +0000, brian m. carlson wrote:\n> I think this patch is fine for now, but given what I mentioned above,\n> maybe we want to add a weather balloon in a future series to see if\n> anyone is compiling with NO_ICONV.  After all, if everybody has easy\n> access to iconv(3), then we might be able to drop support for NO_ICONV\n> and the work maintaining it entails without negatively impacting anyone.\n\nAs you say, for now I'd want this patch to land in our tree to unbreak\nour test suite with NO_ICONV. It fixes the status quo, and whether or\nnot we want to drop NO_ICONV certainly is a bigger discussion.\n\nWe do have one platform that doesn't have iconv, namely QNX. I rather\ndoubt that anybody has access to that platform, or that anybody really\nuses it. So having a test balloon out there could help us figure out\nwhether there are any users of NO_ICONV left. But when it is used I\ndon't mind that flag staying around.\n\nPatrick\n"},{"id":"505326","messageId":"ZxCMmT7tg0tz-ncM@pks.im","threadId":"62330","inReplyTo":"ZxAqA+iyz8EIOeNC@nand.local","subject":"Re: [PATCH v2 02/10] t/test-lib: wire up NO_ICONV prerequisite","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2024-10-17T04:03:37Z","receivedAt":"2024-10-17T04:03:40Z","isPatch":true,"sender":{"key":"ps@pks.im","avatar":"https://avatars.githubusercontent.com/u/4056630?v=4"},"body":"On Wed, Oct 16, 2024 at 05:02:59PM -0400, Taylor Blau wrote:\n> On Wed, Oct 16, 2024 at 04:59:26PM -0400, Taylor Blau wrote:\n> > On Wed, Oct 16, 2024 at 05:57:10AM +0200, Patrick Steinhardt wrote:\n> > > On Tue, Oct 15, 2024 at 07:53:12PM -0400, Taylor Blau wrote:\n> > > > On Tue, Oct 15, 2024 at 01:45:11PM +0200, Patrick Steinhardt wrote:\n> > > > > Further note that there are several \"!MINGW\" conditions in t4201, and\n> > > > > all of these fail due to iconv-related errors. This is quite likely a\n> > > > > leftover from times before dce7d29551 (msvc: support building Git using\n> > > > > MS Visual C++, 2019-06-25), which switched Windows-based builds over\n> > > > > from \"NO_ICONV=YesPlease\" to \"NEEDS_LIBICONV=YesPlease\". Consequently,\n> > > > > adapt those tests to also use the new ICONV prerequisite.\n> > > >\n> > > > This appears to break CI on Windows when I merged this into 'jch':\n> > > >\n> > > >     https://github.com/ttaylorr/git/actions/runs/11355564982/job/31585450667\n> > > >\n> > > > I'm going to temporarily eject this from 'jch' and 'seen' until we can\n> > > > properly deal with this.\n> > >\n> > > Ugh, I'm looking forward to the Windows jobs for GitLab CI being merged\n> > > down to next so that I can finally see such regressions before they hit\n> > > our trees. Anyway, thanks for the heads up, will have a look.\n> >\n> > It's OK. Ejecting a topic out of 'seen' is relatively easy as it\n> > requires the following (after removing the line out of Meta/redo-seen.sh):\n> >\n> >     git checkout -B seen jch\n> >     sh Meta/redo-seen.sh\n> >\n> > I was mostly confused why my build of 'seen' passed 'make test' locally,\n> > but failed CI when pushed to GitHub. Of course, I'm not testing on a\n> > Windows machine, and you didn't have easy access to Windows CI runs on\n> > GitLab (for now), so the result makes sense.\n> \n> Speaking of... I have 'ps/ci-gitlab-windows' tagged for 'next' in the\n> next integration round. There is some duplication of patches between\n> that topic and this one (as well as ps/build).\n> \n> How do you want me to handle the dependency?\n\nI'll soon reroll ps/build to depend on all the other series, and will\nevict the duplicate patches from there. I'm happy to send another\nversion of this series here that depends on ps/ci-gitlab-windows, but\nwouldn't mind either if the patch landed via both series.\n\nPatrick\n"},{"id":"506108","messageId":"zod73s7j77gjj2f62clg3utxlxnclbyhjjz3yc74x7zyh35fzy@blwhzqefxyrs","threadId":"62330","inReplyTo":"c046e5f03bf9e3eeda803133b88c3ae414fd0c69.1729060405.git.ps@pks.im","subject":"Re: [PATCH v3 02/10] t/test-lib: wire up NO_ICONV prerequisite","fromName":"Josh Steadmon","fromEmail":"steadmon@google.com","sentAt":"2024-10-25T18:32:47Z","receivedAt":"2024-10-25T18:32:53Z","isPatch":true,"sender":{"key":"steadmon@google.com","avatar":"https://avatars.githubusercontent.com/u/2654920?v=4"},"body":"On 2024.10.16 10:12, Patrick Steinhardt wrote:\n> The iconv library is used by Git to reencode files, commit messages and\n> other things. As such it is a rather integral part, but given that many\n> platforms nowadays use UTF-8 everywhere you can live without support for\n> reencoding in many situations. It is thus optional to build Git with\n> iconv, and some of our platforms wired up in \"config.mak.uname\" disable\n> it. But while we support building without it, running our test suite\n> with \"NO_ICONV=Yes\" causes many test failures.\n> \n> Wire up a new test prerequisite ICONV that gets populated via our\n> GIT-BUILD-OPTIONS. Annotate failing tests accordingly.\n> \n> Note that this commit does not do a deep dive into every single test to\n> assess whether the failure is expected or not. Most of the tests do\n> smell like the expected kind of failure though.\n> \n> Signed-off-by: Patrick Steinhardt <ps@pks.im>\n> ---\n\n\n> diff --git a/t/t6006-rev-list-format.sh b/t/t6006-rev-list-format.sh\n> index f1623b1c06d..2a01a62a2f3 100755\n> --- a/t/t6006-rev-list-format.sh\n> +++ b/t/t6006-rev-list-format.sh\n[snip]\n> @@ -198,7 +218,7 @@ Thu, 7 Apr 2005 15:13:13 -0700\n>  1112911993\n>  EOF\n>  \n> -test_format encoding %e <<EOF\n> +test_format ICONV encoding %e <<EOF\n>  commit $head2\n>  $test_encoding\n>  commit $head1\n> @@ -374,7 +394,7 @@ test_expect_success 'setup complex body' '\n>  \thead3_short=$(git rev-parse --short $head3)\n>  '\n>  \n> -test_format complex-encoding %e <<EOF\n> +test_format ICONV complex-encoding %e <<EOF\n>  commit $head3\n>  $test_encoding\n>  commit $head2\n> diff --git a/t/t7102-reset.sh b/t/t7102-reset.sh\n> index 2add26d7684..e9a6cc72658 100755\n> --- a/t/t7102-reset.sh\n> +++ b/t/t7102-reset.sh\n\nThese two changes subtly break t6006 (in such a way that it still\npasses, but is clearly not testing what we want):\n\n./t6006-rev-list-format.sh: line 92: test_expect_%e: command not found\n"},{"id":"506189","messageId":"ccb2d7cf817a181fab8fb083bdc9f1fed4671749.1730092261.git.ps@pks.im","threadId":"62330","inReplyTo":"zod73s7j77gjj2f62clg3utxlxnclbyhjjz3yc74x7zyh35fzy@blwhzqefxyrs","subject":"[PATCH] t6006: fix prereq handling with `test_format ()`","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2024-10-28T05:14:51Z","receivedAt":"2024-10-28T05:15:03Z","isPatch":true,"sender":{"key":"ps@pks.im","avatar":"https://avatars.githubusercontent.com/u/4056630?v=4"},"body":"In df383b5842 (t/test-lib: wire up NO_ICONV prerequisite, 2024-10-16) we\nhave introduced a new NO_ICONV prerequisite that makes us skip tests in\ncase Git is not compiled with support for iconv. This change subtly\nbroke t6006: while the test suite still passes, some of its tests won't\nexecute because they run into an error.\n\n    ./t6006-rev-list-format.sh: line 92: test_expect_%e: command not found\n\nThe broken tests use `test_format ()`, and the mentioned commit simply\nprepended the new prerequisite to its arguments. But that does not work,\nas the function is not aware of prereqs at all and will now treat all of\nits arguments incorrectly.\n\nFix this by making the function aware of prereqs by accepting an\noptional fourth argument. Adapt the callsites accordingly.\n\nReported-by: Josh Steadmon <steadmon@google.com>\nSigned-off-by: Patrick Steinhardt <ps@pks.im>\n---\n\nOops, good catch. @Taylor, let's maybe queue this fix on top of\nps/platform-compat-fixes, which currently sits in next.\n\nThanks!\n\nPatrick\n\n t/t6006-rev-list-format.sh | 8 ++++----\n 1 file changed, 4 insertions(+), 4 deletions(-)\n\ndiff --git a/t/t6006-rev-list-format.sh b/t/t6006-rev-list-format.sh\nindex 2a01a62a2f..b0ec2fe865 100755\n--- a/t/t6006-rev-list-format.sh\n+++ b/t/t6006-rev-list-format.sh\n@@ -75,7 +75,7 @@ test_expect_success 'setup' '\n \tgit config --unset i18n.commitEncoding\n '\n \n-# usage: test_format [argument...] name format_string [failure] <expected_output\n+# usage: test_format [argument...] name format_string [success|failure] [prereq] <expected_output\n test_format () {\n \tlocal args=\n \twhile true\n@@ -89,7 +89,7 @@ test_format () {\n \t\tesac\n \tdone\n \tcat >expect.$1\n-\ttest_expect_${3:-success} \"format $1\" \"\n+\ttest_expect_${3:-success} $4 \"format $1\" \"\n \t\tgit rev-list $args --pretty=format:'$2' main >output.$1 &&\n \t\ttest_cmp expect.$1 output.$1\n \t\"\n@@ -218,7 +218,7 @@ Thu, 7 Apr 2005 15:13:13 -0700\n 1112911993\n EOF\n \n-test_format ICONV encoding %e <<EOF\n+test_format encoding %e success ICONV <<EOF\n commit $head2\n $test_encoding\n commit $head1\n@@ -394,7 +394,7 @@ test_expect_success 'setup complex body' '\n \thead3_short=$(git rev-parse --short $head3)\n '\n \n-test_format ICONV complex-encoding %e <<EOF\n+test_format complex-encoding %e success ICONV <<EOF\n commit $head3\n $test_encoding\n commit $head2\n-- \n2.47.0.118.gfd3785337b.dirty\n\n"},{"id":"506239","messageId":"Zx/OWlJ6N+tKbLMc@nand.local","threadId":"62330","inReplyTo":"ccb2d7cf817a181fab8fb083bdc9f1fed4671749.1730092261.git.ps@pks.im","subject":"Re: [PATCH] t6006: fix prereq handling with `test_format ()`","fromName":"Taylor Blau","fromEmail":"me@ttaylorr.com","sentAt":"2024-10-28T17:48:10Z","receivedAt":"2024-10-28T17:48:13Z","isPatch":true,"sender":{"key":"me@ttaylorr.com","avatar":"https://avatars.githubusercontent.com/u/301000140?v=4"},"body":"On Mon, Oct 28, 2024 at 06:14:51AM +0100, Patrick Steinhardt wrote:\n> Oops, good catch. @Taylor, let's maybe queue this fix on top of\n> ps/platform-compat-fixes, which currently sits in next.\n\nNoted, thanks, and thanks also for hopping on the fix.\n\nI was wondering how to handle this situation with Junio's scripts, but\napplying the patch on top of ps/platform-compat-fixes and then\nre-building 'next' lands the patch in the expected fashion, without any\nadditional cruft.\n\nI am not sure whether I will do a push-out on Tuesday (as has been my\nschedule since Junio went offline), or Wednesday morning. I suspect that\nthe latter is more likely, but either way, that integration round will\nhave the new patch applied down onto 'next'.\n\nThanks,\nTaylor\n"}]}