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

Re: [PATCH] git-sh-setup.sh: use dashdash with basename call

From
Junio C Hamano <gitster@pobox.com>
Date
Nov 25, 2014, 00:28 UTC
Message-ID
<xmqq3898unrx.fsf@gitster.dls.corp.google.com>
In-Reply-To
<1416870211-13959-1-git-send-email-danwyand@gmail.com>
Dan Wyand <danwyand@gmail.com> writes:
> Calling basename on a argument that starts with a dash, like a login shell,
> will result in an error. This patch adds '--' before the argument so that the
> argument is interpreted properly.
> ---
Makes sense.
Please sign-off your patch (see Documentation/SubmittingPatches).
Show 16 quoted lines
>  git-sh-setup.sh | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/git-sh-setup.sh b/git-sh-setup.sh
> index 9447980..5cdae33 100644
> --- a/git-sh-setup.sh
> +++ b/git-sh-setup.sh
> @@ -81,7 +81,7 @@ if test -n "$OPTIONS_SPEC"; then
>  		echo exit $?
>  	)"
>  else
> -	dashless=$(basename "$0" | sed -e 's/-/ /')
> +	dashless=$(basename -- "$0" | sed -e 's/-/ /')
>  	usage() {
>  		die "usage: $dashless $USAGE"
>  	}
Previous: Dan Wyand
Message 2 of 2 in “git-sh-setup.sh: use dashdash with basename call”
  1. git-sh-setup.sh: use dashdash with basename callDan Wyand, Nov 24, 2014
  2. Junio C HamanoNov 25, 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.