git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] Ensure SHELL_PATH is the hash bang for test suite askpass helper script.

From
Junio C Hamano <gitster@pobox.com>
Date
Sep 29, 2014, 17:49 UTC
Message-ID
<xmqq38bauxkg.fsf@gitster.dls.corp.google.com>
In-Reply-To
<1411974127-5258-1-git-send-email-bdwalton@gmail.com>
Ben Walton <bdwalton@gmail.com> writes:
Show 10 quoted lines
> The askpass script that is created for use by the test suite should
> use SHELL_PATH for its hash bang instead of /bin/sh. Commit 5a4352024
> introduced the use of idioms not supported in some legacy /bin/sh
> implementations.
>
> Use write_script to ensure this happens automatically. This lets us
> remove the chmod step as well, since write_script handles that.
>
> Signed-off-by: Ben Walton <bdwalton@gmail.com>
> ---

I'll leave out the "some legacy shells we do not support want to use `command`" from the justification of this change. Use of the write_script helper is the right thing to do---$SHELL_PATH points at the shell the user told us s/he wants to use, and that is a reason enough for this change. The reason why the user wants to use that shell is immaterial.

Thanks.
Show 21 quoted lines
>  t/lib-credential.sh | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/t/lib-credential.sh b/t/lib-credential.sh
> index 9e7d796..d8e41f7 100755
> --- a/t/lib-credential.sh
> +++ b/t/lib-credential.sh
> @@ -278,12 +278,10 @@ helper_test_timeout() {
>  	'
>  }
>  
> -cat >askpass <<\EOF
> -#!/bin/sh
> +write_script askpass <<\EOF
>  echo >&2 askpass: $*
>  what=$(echo $1 | cut -d" " -f1 | tr A-Z a-z | tr -cd a-z)
>  echo "askpass-$what"
>  EOF
> -chmod +x askpass
>  GIT_ASKPASS="$PWD/askpass"
>  export GIT_ASKPASS
Previous: Jeff King
Message 5 of 5 in “Use SHELL_PATH as hash bang in test suite askpass helper script.”
  1. Use SHELL_PATH as hash bang in test suite askpass helper script.Ben Walton, Sep 28, 2014
  2. Jeff KingSep 28, 2014
  3. Ensure SHELL_PATH is the hash bang for test suite askpass helper script.Ben Walton, Sep 29, 2014
  4. Jeff KingSep 29, 2014
  5. Junio C HamanoSep 29, 2014

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.