{"thread":{"id":"66835","subject":"several unquoted shell variables causing test failures on Solaris","startedAt":"2026-11-12T15:39:01Z","lastAt":"2026-11-18T17:08:28Z","messageCount":4,"participants":["Jakub Kulik","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"558298","messageId":"SJ0PR10MB5785807828F81EAC8CA165E78A702@SJ0PR10MB5785.namprd10.prod.outlook.com","threadId":"66835","inReplyTo":null,"subject":"several unquoted shell variables causing test failures on Solaris","fromName":"Jakub Kulik","fromEmail":"jakub.kulik@oracle.com","sentAt":"2026-11-12T15:39:01Z","receivedAt":"2026-11-12T15:39:01Z","isPatch":false,"sender":{"key":"jakub.kulik@oracle.com","avatar":null},"body":"Hi, when running tests on Solaris, I encountered several test failures in 't1017-cat-file-remote-object-info.sh' which look like this:\n\n./test-lib.sh: line 1040: cd: /builds/components/git/build/amd64/t/trash directory.t1017-cat-file-remote-object-info/repo/parent/daemon_client_empty: No such file or directory\nnot ok 12 - requesting only objectname echoes back\n\nThe reason seems to be several unquoted variables (needed because of the space in path), and with the following change, the test is fixed again:\n\n--- git-2.56.0/t/t1017-cat-file-remote-object-info.sh\n+++ git-2.56.0/t/t1017-cat-file-remote-object-info.sh\n@@ -69,7 +69,7 @@ daemon_parent=$GIT_DAEMON_DOCUMENT_ROOT_\n \n test_expect_success 'create repo to be served by git-daemon' '\n      git init \"$daemon_parent\" &&\n-     echo_without_newline \"$hello_content\" > $daemon_parent/hello &&\n+     echo_without_newline \"$hello_content\" > \"$daemon_parent/hello\" &&\n      git -C \"$daemon_parent\" update-index --add hello &&\n      git -C \"$daemon_parent\" config transfer.advertiseobjectinfo true &&\n      git clone \"$GIT_DAEMON_URL/parent\" -n \"$daemon_parent/daemon_client_empty\"\n@@ -519,7 +519,7 @@ test_expect_success 'create repo to be s\n      git init \"$HTTPD_DOCUMENT_ROOT_PATH/http_parent\" &&\n      git -C \"$HTTPD_DOCUMENT_ROOT_PATH/http_parent\" config http.receivepack true &&\n      git -C \"$HTTPD_DOCUMENT_ROOT_PATH/http_parent\" config transfer.advertiseobjectinfo true &&\n-     echo_without_newline \"$hello_content\" > $HTTPD_DOCUMENT_ROOT_PATH/http_parent/hello &&\n+     echo_without_newline \"$hello_content\" > \"$HTTPD_DOCUMENT_ROOT_PATH/http_parent/hello\" &&\n      git -C \"$HTTPD_DOCUMENT_ROOT_PATH/http_parent\" update-index --add hello &&\n      git clone \"$HTTPD_URL/smart/http_parent\" -n \"$HTTPD_DOCUMENT_ROOT_PATH/http_client_empty\"\n '\n\nBest Regards,\nJakub\n\n"},{"id":"558345","messageId":"xmqqik21hiqi.fsf@gitster.g","threadId":"66835","inReplyTo":"SJ0PR10MB5785807828F81EAC8CA165E78A702@SJ0PR10MB5785.namprd10.prod.outlook.com","subject":"Re: several unquoted shell variables causing test failures on Solaris","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2026-11-12T20:56:05Z","receivedAt":"2026-11-12T20:56:05Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jakub Kulik <jakub.kulik@oracle.com> writes:\n\n> Hi, when running tests on Solaris, I encountered several test failures in 't1017-cat-file-remote-object-info.sh' which look like this:\n>\n> ./test-lib.sh: line 1040: cd: /builds/components/git/build/amd64/t/trash directory.t1017-cat-file-remote-object-info/repo/parent/daemon_client_empty: No such file or directory\n> not ok 12 - requesting only objectname echoes back\n>\n> The reason seems to be several unquoted variables (needed because\n> of the space in path), and with the following change, the test is\n> fixed again:\n\nStrictly speaking, POSIX compliant shells do not require such\nquoting for pathnames that are used as redirection target.\n\nBut some shells are buggy, and our Documentation/CodingGuidelines do\nrequire them to be quoted.  It also does require there is no space\nbetween redirection operator '>' and the filename, so the correct\nformulation would be:\n\n> -     echo_without_newline \"$hello_content\" > $daemon_parent/hello &&\n> +     echo_without_newline \"$hello_content\" > \"$daemon_parent/hello\" &&\n\n\techo_without_newline \"$hello_content\" >\"$daemon_parent/hello\" &&\n\nCare to submit an official fix with commit log message and sign off?\n\nThanks.\n\n"},{"id":"558718","messageId":"20261118155935.60345-1-jakub.kulik@oracle.com","threadId":"66835","inReplyTo":"xmqqik21hiqi.fsf@gitster.g","subject":"[PATCH] t1017: add missing quotes","fromName":"Jakub Kulik","fromEmail":"jakub.kulik@oracle.com","sentAt":"2026-11-18T15:59:35Z","receivedAt":"2026-11-18T15:59:35Z","isPatch":true,"sender":{"key":"jakub.kulik@oracle.com","avatar":null},"body":"Signed-off-by: Jakub Kulik <jakub.kulik@oracle.com>\n---\n> Strictly speaking, POSIX compliant shells do not require such\n> quoting for pathnames that are used as redirection target.\n\nIndeed; when I run it with `bash --posix`, the test passes.\n\nHere is the patch with space between > and the filename removed.\n\n t/t1017-cat-file-remote-object-info.sh | 4 ++--\n 1 file changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/t/t1017-cat-file-remote-object-info.sh b/t/t1017-cat-file-remote-object-info.sh\nindex e2919aa061..8a04cfdae8 100755\n--- a/t/t1017-cat-file-remote-object-info.sh\n+++ b/t/t1017-cat-file-remote-object-info.sh\n@@ -69,7 +69,7 @@ daemon_parent=$GIT_DAEMON_DOCUMENT_ROOT_PATH/parent\n \n test_expect_success 'create repo to be served by git-daemon' '\n \tgit init \"$daemon_parent\" &&\n-\techo_without_newline \"$hello_content\" > $daemon_parent/hello &&\n+\techo_without_newline \"$hello_content\" >\"$daemon_parent/hello\" &&\n \tgit -C \"$daemon_parent\" update-index --add hello &&\n \tgit -C \"$daemon_parent\" config transfer.advertiseobjectinfo true &&\n \tgit clone \"$GIT_DAEMON_URL/parent\" -n \"$daemon_parent/daemon_client_empty\"\n@@ -519,7 +519,7 @@ test_expect_success 'create repo to be served by http:// transport' '\n \tgit init \"$HTTPD_DOCUMENT_ROOT_PATH/http_parent\" &&\n \tgit -C \"$HTTPD_DOCUMENT_ROOT_PATH/http_parent\" config http.receivepack true &&\n \tgit -C \"$HTTPD_DOCUMENT_ROOT_PATH/http_parent\" config transfer.advertiseobjectinfo true &&\n-\techo_without_newline \"$hello_content\" > $HTTPD_DOCUMENT_ROOT_PATH/http_parent/hello &&\n+\techo_without_newline \"$hello_content\" >\"$HTTPD_DOCUMENT_ROOT_PATH/http_parent/hello\" &&\n \tgit -C \"$HTTPD_DOCUMENT_ROOT_PATH/http_parent\" update-index --add hello &&\n \tgit clone \"$HTTPD_URL/smart/http_parent\" -n \"$HTTPD_DOCUMENT_ROOT_PATH/http_client_empty\"\n '\n-- \n2.51.0\n\n\n"},{"id":"558727","messageId":"xmqqo6bm6p9v.fsf@gitster.g","threadId":"66835","inReplyTo":"20261118155935.60345-1-jakub.kulik@oracle.com","subject":"Re: [PATCH] t1017: add missing quotes","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2026-11-18T17:08:28Z","receivedAt":"2026-11-18T17:08:28Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jakub Kulik <jakub.kulik@oracle.com> writes:\n\n> Signed-off-by: Jakub Kulik <jakub.kulik@oracle.com>\n> ---\n>> Strictly speaking, POSIX compliant shells do not require such\n>> quoting for pathnames that are used as redirection target.\n>\n> Indeed; when I run it with `bash --posix`, the test passes.\n>\n> Here is the patch with space between > and the filename removed.\n\nThanks.\n\nI would fabricate a log message to say something about our\nCodingGuidelines ask you to quote variable references used for\nredirection targets or sources while queuing.\n\n>\n>  t/t1017-cat-file-remote-object-info.sh | 4 ++--\n>  1 file changed, 2 insertions(+), 2 deletions(-)\n>\n> diff --git a/t/t1017-cat-file-remote-object-info.sh b/t/t1017-cat-file-remote-object-info.sh\n> index e2919aa061..8a04cfdae8 100755\n> --- a/t/t1017-cat-file-remote-object-info.sh\n> +++ b/t/t1017-cat-file-remote-object-info.sh\n> @@ -69,7 +69,7 @@ daemon_parent=$GIT_DAEMON_DOCUMENT_ROOT_PATH/parent\n>  \n>  test_expect_success 'create repo to be served by git-daemon' '\n>  \tgit init \"$daemon_parent\" &&\n> -\techo_without_newline \"$hello_content\" > $daemon_parent/hello &&\n> +\techo_without_newline \"$hello_content\" >\"$daemon_parent/hello\" &&\n>  \tgit -C \"$daemon_parent\" update-index --add hello &&\n>  \tgit -C \"$daemon_parent\" config transfer.advertiseobjectinfo true &&\n>  \tgit clone \"$GIT_DAEMON_URL/parent\" -n \"$daemon_parent/daemon_client_empty\"\n> @@ -519,7 +519,7 @@ test_expect_success 'create repo to be served by http:// transport' '\n>  \tgit init \"$HTTPD_DOCUMENT_ROOT_PATH/http_parent\" &&\n>  \tgit -C \"$HTTPD_DOCUMENT_ROOT_PATH/http_parent\" config http.receivepack true &&\n>  \tgit -C \"$HTTPD_DOCUMENT_ROOT_PATH/http_parent\" config transfer.advertiseobjectinfo true &&\n> -\techo_without_newline \"$hello_content\" > $HTTPD_DOCUMENT_ROOT_PATH/http_parent/hello &&\n> +\techo_without_newline \"$hello_content\" >\"$HTTPD_DOCUMENT_ROOT_PATH/http_parent/hello\" &&\n>  \tgit -C \"$HTTPD_DOCUMENT_ROOT_PATH/http_parent\" update-index --add hello &&\n>  \tgit clone \"$HTTPD_URL/smart/http_parent\" -n \"$HTTPD_DOCUMENT_ROOT_PATH/http_client_empty\"\n>  '\n\n"}]}