{"thread":{"id":"28252","subject":"[PATCH] t6030: use $SHELL_PATH to invoke user's preferred shell instead of bare sh","startedAt":"2011-08-29T20:09:25Z","lastAt":"2011-08-30T20:55:06Z","messageCount":4,"participants":["Brandon Casey","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"174484","messageId":"Sn_8tnPB8FBe4C5QxoGkIRcdzJ2sLq_-h0oZ37fkrq42HJgWSlGgty_hMznS2ckiKKOg66yY7R2mRQqhJAzedr762dMKb_s6ELjELyGXyU-tkJzir-FnxhCkAIb3q1028d5FrBBy6EW3SXEPBMTYTw@cipher.nrlssc.navy.mil","threadId":"28252","inReplyTo":null,"subject":"[PATCH] t6030: use $SHELL_PATH to invoke user's preferred shell instead of bare sh","fromName":"Brandon Casey","fromEmail":"casey@nrlssc.navy.mil","sentAt":"2011-08-29T20:09:25Z","receivedAt":"2011-08-29T20:09:25Z","isPatch":true,"sender":{"key":"drafnel@gmail.com","avatar":"https://avatars.githubusercontent.com/u/921167?v=4"},"body":"From: Brandon Casey <drafnel@gmail.com>\n\nSome platforms (IRIX, Solaris) provide an ancient /bin/sh which chokes on\nmodern shell syntax like $().  SHELL_PATH is provided to allow the user to\nspecify a working sh, let's use it here.\n\nSigned-off-by: Brandon Casey <casey@nrlssc.navy.mil>\n---\n t/t6030-bisect-porcelain.sh |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/t/t6030-bisect-porcelain.sh b/t/t6030-bisect-porcelain.sh\nindex 62125ec..c53af62 100755\n--- a/t/t6030-bisect-porcelain.sh\n+++ b/t/t6030-bisect-porcelain.sh\n@@ -732,7 +732,7 @@ test_expect_success 'bisect: demonstrate identification of damage boundary' \"\n \tgit bisect reset &&\n \tgit checkout broken &&\n \tgit bisect start broken master --no-checkout &&\n-\tgit bisect run sh -c '\n+\tgit bisect run \\\"$SHELL_PATH\\\" -c '\n \t\tGOOD=\\$(git for-each-ref \\\"--format=%(objectname)\\\" refs/bisect/good-*) &&\n \t\tgit rev-list --objects BISECT_HEAD --not \\$GOOD >tmp.\\$\\$ &&\n \t\tgit pack-objects --stdout >/dev/null < tmp.\\$\\$\n-- \n1.7.6.1\n"},{"id":"174580","messageId":"7vfwki1wqo.fsf@alter.siamese.dyndns.org","threadId":"28252","inReplyTo":"Sn_8tnPB8FBe4C5QxoGkIRcdzJ2sLq_-h0oZ37fkrq42HJgWSlGgty_hMznS2ckiKKOg66yY7R2mRQqhJAzedr762dMKb_s6ELjELyGXyU-tkJzir-FnxhCkAIb3q1028d5FrBBy6EW3SXEPBMTYTw@cipher.nrlssc.navy.mil","subject":"Re: [PATCH] t6030: use $SHELL_PATH to invoke user's preferred shell instead of bare sh","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2011-08-30T20:15:59Z","receivedAt":"2011-08-30T20:15:59Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Brandon Casey <casey@nrlssc.navy.mil> writes:\n\n> From: Brandon Casey <drafnel@gmail.com>\n>\n> Some platforms (IRIX, Solaris) provide an ancient /bin/sh which chokes on\n> modern shell syntax like $().  SHELL_PATH is provided to allow the user to\n> specify a working sh, let's use it here.\n>\n> Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>\n> ---\n>  t/t6030-bisect-porcelain.sh |    2 +-\n>  1 files changed, 1 insertions(+), 1 deletions(-)\n>\n> diff --git a/t/t6030-bisect-porcelain.sh b/t/t6030-bisect-porcelain.sh\n> index 62125ec..c53af62 100755\n> --- a/t/t6030-bisect-porcelain.sh\n> +++ b/t/t6030-bisect-porcelain.sh\n> @@ -732,7 +732,7 @@ test_expect_success 'bisect: demonstrate identification of damage boundary' \"\n>  \tgit bisect reset &&\n>  \tgit checkout broken &&\n>  \tgit bisect start broken master --no-checkout &&\n> -\tgit bisect run sh -c '\n> +\tgit bisect run \\\"$SHELL_PATH\\\" -c '\n>  \t\tGOOD=\\$(git for-each-ref \\\"--format=%(objectname)\\\" refs/bisect/good-*) &&\n>  \t\tgit rev-list --objects BISECT_HEAD --not \\$GOOD >tmp.\\$\\$ &&\n>  \t\tgit pack-objects --stdout >/dev/null < tmp.\\$\\$\n\nHmm, shouldn't we also be quoting '$' in front of SHELL_PATH to make the\ntest_expect_success interpolate the value of SHELL_PATH, instead of hoping\nthat SHELL_PATH does not have double-quote in it when the shell that forms\nparameters given to test_expect_success interpolates it?\n"},{"id":"174582","messageId":"7vaaaq1w6x.fsf@alter.siamese.dyndns.org","threadId":"28252","inReplyTo":"7vfwki1wqo.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH] t6030: use $SHELL_PATH to invoke user's preferred shell instead of bare sh","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2011-08-30T20:27:50Z","receivedAt":"2011-08-30T20:27:50Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n>> +\tgit bisect run \\\"$SHELL_PATH\\\" -c '\n>>  \t\tGOOD=\\$(git for-each-ref \\\"--format=%(objectname)\\\" refs/bisect/good-*) &&\n>>  \t\tgit rev-list --objects BISECT_HEAD --not \\$GOOD >tmp.\\$\\$ &&\n>>  \t\tgit pack-objects --stdout >/dev/null < tmp.\\$\\$\n>\n> Hmm, shouldn't we also be quoting '$' in front of SHELL_PATH to make the\n> test_expect_success interpolate the value of SHELL_PATH, instead of hoping\n> that SHELL_PATH does not have double-quote in it when the shell that forms\n> parameters given to test_expect_success interpolates it?\n\nBy doing this silly thing:\n\n\t$ mkdir '/var/tmp/a\"b c/'\n        $ ln -s /bin/sh '/var/tmp/a\"b c/shell'\n\nand then adding\n\n\tSHELL_PATH='/var/tmp/a\"b c/shell'\n\nafter we source \"test-lib.sh\" in t6030, I see this breaks when the shell\nparses to figure out what parameters to call test_expect_success with.\n\n t/t6030-bisect-porcelain.sh |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/t/t6030-bisect-porcelain.sh b/t/t6030-bisect-porcelain.sh\nindex 68c0e97..cd9de63 100755\n--- a/t/t6030-bisect-porcelain.sh\n+++ b/t/t6030-bisect-porcelain.sh\n@@ -701,7 +701,7 @@ test_expect_success 'bisect: demonstrate identification of damage boundary' \"\n \tgit bisect reset &&\n \tgit checkout broken &&\n \tgit bisect start broken master --no-checkout &&\n-\tgit bisect run \\\"$SHELL_PATH\\\" -c '\n+\tgit bisect run \\\"\\$SHELL_PATH\\\" -c '\n \t\tGOOD=\\$(git for-each-ref \\\"--format=%(objectname)\\\" refs/bisect/good-*) &&\n \t\tgit rev-list --objects BISECT_HEAD --not \\$GOOD >tmp.\\$\\$ &&\n \t\tgit pack-objects --stdout >/dev/null < tmp.\\$\\$\n"},{"id":"174584","messageId":"9Mf0-hbcq2yQhZea9SPcW_u7qYq8G669j-m6nWbGmCA50MnYbUc0VyfjRoRkKCY9LZKWWqwZZVQfQlC6f2mFgdGd1OG7z0-ILDeRZolzPpA@cipher.nrlssc.navy.mil","threadId":"28252","inReplyTo":"7vaaaq1w6x.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH] t6030: use $SHELL_PATH to invoke user's preferred shell instead of bare sh","fromName":"Brandon Casey","fromEmail":"casey@nrlssc.navy.mil","sentAt":"2011-08-30T20:55:06Z","receivedAt":"2011-08-30T20:55:06Z","isPatch":true,"sender":{"key":"drafnel@gmail.com","avatar":"https://avatars.githubusercontent.com/u/921167?v=4"},"body":"On 08/30/2011 03:27 PM, Junio C Hamano wrote:\n> Junio C Hamano <gitster@pobox.com> writes:\n> \n>>> +\tgit bisect run \\\"$SHELL_PATH\\\" -c '\n>>>  \t\tGOOD=\\$(git for-each-ref \\\"--format=%(objectname)\\\" refs/bisect/good-*) &&\n>>>  \t\tgit rev-list --objects BISECT_HEAD --not \\$GOOD >tmp.\\$\\$ &&\n>>>  \t\tgit pack-objects --stdout >/dev/null < tmp.\\$\\$\n>>\n>> Hmm, shouldn't we also be quoting '$' in front of SHELL_PATH to make the\n>> test_expect_success interpolate the value of SHELL_PATH, instead of hoping\n>> that SHELL_PATH does not have double-quote in it when the shell that forms\n>> parameters given to test_expect_success interpolates it?\n\nYep, makes sense.  Good catch.  Thanks.\n\n-Brandon\n\n\n> By doing this silly thing:\n> \n> \t$ mkdir '/var/tmp/a\"b c/'\n>         $ ln -s /bin/sh '/var/tmp/a\"b c/shell'\n> \n> and then adding\n> \n> \tSHELL_PATH='/var/tmp/a\"b c/shell'\n> \n> after we source \"test-lib.sh\" in t6030, I see this breaks when the shell\n> parses to figure out what parameters to call test_expect_success with.\n> \n>  t/t6030-bisect-porcelain.sh |    2 +-\n>  1 files changed, 1 insertions(+), 1 deletions(-)\n> \n> diff --git a/t/t6030-bisect-porcelain.sh b/t/t6030-bisect-porcelain.sh\n> index 68c0e97..cd9de63 100755\n> --- a/t/t6030-bisect-porcelain.sh\n> +++ b/t/t6030-bisect-porcelain.sh\n> @@ -701,7 +701,7 @@ test_expect_success 'bisect: demonstrate identification of damage boundary' \"\n>  \tgit bisect reset &&\n>  \tgit checkout broken &&\n>  \tgit bisect start broken master --no-checkout &&\n> -\tgit bisect run \\\"$SHELL_PATH\\\" -c '\n> +\tgit bisect run \\\"\\$SHELL_PATH\\\" -c '\n>  \t\tGOOD=\\$(git for-each-ref \\\"--format=%(objectname)\\\" refs/bisect/good-*) &&\n>  \t\tgit rev-list --objects BISECT_HEAD --not \\$GOOD >tmp.\\$\\$ &&\n>  \t\tgit pack-objects --stdout >/dev/null < tmp.\\$\\$\n"}]}