All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Dan Wyand <danwyand@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] git-sh-setup.sh: use dashdash with basename call
Date: Mon, 24 Nov 2014 16:28:18 -0800	[thread overview]
Message-ID: <xmqq3898unrx.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <1416870211-13959-1-git-send-email-danwyand@gmail.com> (Dan Wyand's message of "Mon, 24 Nov 2014 18:03:31 -0500")

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).

>  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"
>  	}

  reply	other threads:[~2014-11-25  0:28 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-24 23:03 [PATCH] git-sh-setup.sh: use dashdash with basename call Dan Wyand
2014-11-25  0:28 ` Junio C Hamano [this message]
  -- strict thread matches above, loose matches on Subject: below --
2014-11-24 23:20 Dan Wyand

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqq3898unrx.fsf@gitster.dls.corp.google.com \
    --to=gitster@pobox.com \
    --cc=danwyand@gmail.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.