{"thread":{"id":"37642","subject":"[PATCH] Use SHELL_PATH as hash bang in test suite askpass helper script.","startedAt":"2014-09-28T22:21:07Z","lastAt":"2014-09-29T17:49:03Z","messageCount":5,"participants":["Ben Walton","Jeff King","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"249982","messageId":"1411942867-3995-1-git-send-email-bdwalton@gmail.com","threadId":"37642","inReplyTo":null,"subject":"[PATCH] Use SHELL_PATH as hash bang in test suite askpass helper script.","fromName":"Ben Walton","fromEmail":"bdwalton@gmail.com","sentAt":"2014-09-28T22:21:07Z","receivedAt":"2014-09-28T22:21:07Z","isPatch":true,"sender":{"key":"bdwalton@gmail.com","avatar":"https://avatars.githubusercontent.com/u/396061?v=4"},"body":"The askpass script that is created for use by the test suite should\nuse SHELL_PATH for its hash bang instead of /bin/sh. Commit 5a4352024\nintroduced the use of idioms not supported in some legacy /bin/sh\nimplementations.\n\nSigned-off-by: Ben Walton <bdwalton@gmail.com>\n---\n t/lib-credential.sh | 4 ++--\n 1 file changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/t/lib-credential.sh b/t/lib-credential.sh\nindex 9e7d796..ca4a6de 100755\n--- a/t/lib-credential.sh\n+++ b/t/lib-credential.sh\n@@ -278,8 +278,8 @@ helper_test_timeout() {\n \t'\n }\n \n-cat >askpass <<\\EOF\n-#!/bin/sh\n+echo \"#!$SHELL_PATH\" >askpass\n+cat >>askpass <<\\EOF\n echo >&2 askpass: $*\n what=$(echo $1 | cut -d\" \" -f1 | tr A-Z a-z | tr -cd a-z)\n echo \"askpass-$what\"\n-- \n1.9.1\n"},{"id":"249983","messageId":"20140928231428.GA9061@peff.net","threadId":"37642","inReplyTo":"1411942867-3995-1-git-send-email-bdwalton@gmail.com","subject":"Re: [PATCH] Use SHELL_PATH as hash bang in test suite askpass helper script.","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2014-09-28T23:14:28Z","receivedAt":"2014-09-28T23:14:28Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Sun, Sep 28, 2014 at 11:21:07PM +0100, Ben Walton wrote:\n\n> The askpass script that is created for use by the test suite should\n> use SHELL_PATH for its hash bang instead of /bin/sh. Commit 5a4352024\n> introduced the use of idioms not supported in some legacy /bin/sh\n> implementations.\n\nSounds good.\n\n> -cat >askpass <<\\EOF\n> -#!/bin/sh\n> +echo \"#!$SHELL_PATH\" >askpass\n> +cat >>askpass <<\\EOF\n\nThis can just become:\n\n  write_script askpass <<\\EOF\n\nwhich handles this for us (and you can get rid of the manual chmod then,\ntoo).\n\n-Peff\n"},{"id":"249984","messageId":"1411974127-5258-1-git-send-email-bdwalton@gmail.com","threadId":"37642","inReplyTo":"20140928231428.GA9061@peff.net","subject":"[PATCH] Ensure SHELL_PATH is the hash bang for test suite askpass helper script.","fromName":"Ben Walton","fromEmail":"bdwalton@gmail.com","sentAt":"2014-09-29T07:02:07Z","receivedAt":"2014-09-29T07:02:07Z","isPatch":true,"sender":{"key":"bdwalton@gmail.com","avatar":"https://avatars.githubusercontent.com/u/396061?v=4"},"body":"The askpass script that is created for use by the test suite should\nuse SHELL_PATH for its hash bang instead of /bin/sh. Commit 5a4352024\nintroduced the use of idioms not supported in some legacy /bin/sh\nimplementations.\n\nUse write_script to ensure this happens automatically. This lets us\nremove the chmod step as well, since write_script handles that.\n\nSigned-off-by: Ben Walton <bdwalton@gmail.com>\n---\n t/lib-credential.sh | 4 +---\n 1 file changed, 1 insertion(+), 3 deletions(-)\n\ndiff --git a/t/lib-credential.sh b/t/lib-credential.sh\nindex 9e7d796..d8e41f7 100755\n--- a/t/lib-credential.sh\n+++ b/t/lib-credential.sh\n@@ -278,12 +278,10 @@ helper_test_timeout() {\n \t'\n }\n \n-cat >askpass <<\\EOF\n-#!/bin/sh\n+write_script askpass <<\\EOF\n echo >&2 askpass: $*\n what=$(echo $1 | cut -d\" \" -f1 | tr A-Z a-z | tr -cd a-z)\n echo \"askpass-$what\"\n EOF\n-chmod +x askpass\n GIT_ASKPASS=\"$PWD/askpass\"\n export GIT_ASKPASS\n-- \n1.9.1\n"},{"id":"249999","messageId":"20140929173034.GA3845@peff.net","threadId":"37642","inReplyTo":"1411974127-5258-1-git-send-email-bdwalton@gmail.com","subject":"Re: [PATCH] Ensure SHELL_PATH is the hash bang for test suite askpass helper script.","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2014-09-29T17:30:34Z","receivedAt":"2014-09-29T17:30:34Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Mon, Sep 29, 2014 at 08:02:07AM +0100, Ben Walton wrote:\n\n> The askpass script that is created for use by the test suite should\n> use SHELL_PATH for its hash bang instead of /bin/sh. Commit 5a4352024\n> introduced the use of idioms not supported in some legacy /bin/sh\n> implementations.\n> \n> Use write_script to ensure this happens automatically. This lets us\n> remove the chmod step as well, since write_script handles that.\n> \n> Signed-off-by: Ben Walton <bdwalton@gmail.com>\n\nThanks, this looks good to me.\n\n-Peff\n"},{"id":"250001","messageId":"xmqq38bauxkg.fsf@gitster.dls.corp.google.com","threadId":"37642","inReplyTo":"1411974127-5258-1-git-send-email-bdwalton@gmail.com","subject":"Re: [PATCH] Ensure SHELL_PATH is the hash bang for test suite askpass helper script.","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2014-09-29T17:49:03Z","receivedAt":"2014-09-29T17:49:03Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Ben Walton <bdwalton@gmail.com> writes:\n\n> The askpass script that is created for use by the test suite should\n> use SHELL_PATH for its hash bang instead of /bin/sh. Commit 5a4352024\n> introduced the use of idioms not supported in some legacy /bin/sh\n> implementations.\n>\n> Use write_script to ensure this happens automatically. This lets us\n> remove the chmod step as well, since write_script handles that.\n>\n> Signed-off-by: Ben Walton <bdwalton@gmail.com>\n> ---\n\nI'll leave out the \"some legacy shells we do not support want to use\n`command`\" from the justification of this change.  Use of the\nwrite_script helper is the right thing to do---$SHELL_PATH points at\nthe shell the user told us s/he wants to use, and that is a reason\nenough for this change.  The reason why the user wants to use that\nshell is immaterial.\n\nThanks.\n\n\n>  t/lib-credential.sh | 4 +---\n>  1 file changed, 1 insertion(+), 3 deletions(-)\n>\n> diff --git a/t/lib-credential.sh b/t/lib-credential.sh\n> index 9e7d796..d8e41f7 100755\n> --- a/t/lib-credential.sh\n> +++ b/t/lib-credential.sh\n> @@ -278,12 +278,10 @@ helper_test_timeout() {\n>  \t'\n>  }\n>  \n> -cat >askpass <<\\EOF\n> -#!/bin/sh\n> +write_script askpass <<\\EOF\n>  echo >&2 askpass: $*\n>  what=$(echo $1 | cut -d\" \" -f1 | tr A-Z a-z | tr -cd a-z)\n>  echo \"askpass-$what\"\n>  EOF\n> -chmod +x askpass\n>  GIT_ASKPASS=\"$PWD/askpass\"\n>  export GIT_ASKPASS\n"}]}