{"thread":{"id":"38039","subject":"[PATCH] git-sh-setup.sh: use dashdash with basename call","startedAt":"2014-11-24T23:03:31Z","lastAt":"2014-11-25T00:28:18Z","messageCount":2,"participants":["Dan Wyand","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"252467","messageId":"1416870211-13959-1-git-send-email-danwyand@gmail.com","threadId":"38039","inReplyTo":null,"subject":"[PATCH] git-sh-setup.sh: use dashdash with basename call","fromName":"Dan Wyand","fromEmail":"danwyand@gmail.com","sentAt":"2014-11-24T23:03:31Z","receivedAt":"2014-11-24T23:03:31Z","isPatch":true,"sender":{"key":"danwyand@gmail.com","avatar":null},"body":"Calling basename on a argument that starts with a dash, like a login shell,\nwill result in an error. This patch adds '--' before the argument so that the\nargument is interpreted properly.\n---\n git-sh-setup.sh | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/git-sh-setup.sh b/git-sh-setup.sh\nindex 9447980..5cdae33 100644\n--- a/git-sh-setup.sh\n+++ b/git-sh-setup.sh\n@@ -81,7 +81,7 @@ if test -n \"$OPTIONS_SPEC\"; then\n \t\techo exit $?\n \t)\"\n else\n-\tdashless=$(basename \"$0\" | sed -e 's/-/ /')\n+\tdashless=$(basename -- \"$0\" | sed -e 's/-/ /')\n \tusage() {\n \t\tdie \"usage: $dashless $USAGE\"\n \t}\n-- \n2.1.3\n"},{"id":"252475","messageId":"xmqq3898unrx.fsf@gitster.dls.corp.google.com","threadId":"38039","inReplyTo":"1416870211-13959-1-git-send-email-danwyand@gmail.com","subject":"Re: [PATCH] git-sh-setup.sh: use dashdash with basename call","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2014-11-25T00:28:18Z","receivedAt":"2014-11-25T00:28:18Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Dan Wyand <danwyand@gmail.com> writes:\n\n> Calling basename on a argument that starts with a dash, like a login shell,\n> will result in an error. This patch adds '--' before the argument so that the\n> argument is interpreted properly.\n> ---\n\nMakes sense.\n\nPlease sign-off your patch (see Documentation/SubmittingPatches).\n\n>  git-sh-setup.sh | 2 +-\n>  1 file changed, 1 insertion(+), 1 deletion(-)\n>\n> diff --git a/git-sh-setup.sh b/git-sh-setup.sh\n> index 9447980..5cdae33 100644\n> --- a/git-sh-setup.sh\n> +++ b/git-sh-setup.sh\n> @@ -81,7 +81,7 @@ if test -n \"$OPTIONS_SPEC\"; then\n>  \t\techo exit $?\n>  \t)\"\n>  else\n> -\tdashless=$(basename \"$0\" | sed -e 's/-/ /')\n> +\tdashless=$(basename -- \"$0\" | sed -e 's/-/ /')\n>  \tusage() {\n>  \t\tdie \"usage: $dashless $USAGE\"\n>  \t}\n"}]}