From: Junio C Hamano <gitster@pobox.com>
To: Thomas Rast <trast@student.ethz.ch>
Cc: "W. Trevor King" <wking@tremily.us>, Git <git@vger.kernel.org>
Subject: Re: [PATCH] Documentation/githooks: Explain pre-rebase parameters
Date: Tue, 19 Feb 2013 09:05:58 -0800 [thread overview]
Message-ID: <7vliak6xop.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <878v6ksars.fsf@pctrast.inf.ethz.ch> (Thomas Rast's message of "Tue, 19 Feb 2013 14:17:43 +0100")
Thomas Rast <trast@student.ethz.ch> writes:
>> "$GIT_DIR/hooks/pre-rebase" ${1+"$@"}
> ...
> IIRC this particular usage was designed to suppress warnings about unset
> variables.
This is an old-timer's habit to work around buggy implementations of
Bourne shells where they failed to expand "$@" to nothing when there
is no parameters, feeding a single empty argument to the command.
By explicitly writing ${1+...}, the construct makes sure that when
we have no parameter (i.e. $1 is unset) we do not even look at "$@".
It is equivalent to "$@" in correctly implemented shells.
next prev parent reply other threads:[~2013-02-19 17:06 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-19 11:03 [PATCH] Documentation/githooks: Explain pre-rebase parameters W. Trevor King
2013-02-19 13:17 ` Thomas Rast
2013-02-19 13:23 ` W. Trevor King
2013-02-19 17:05 ` Junio C Hamano [this message]
2013-02-19 19:08 ` Junio C Hamano
2013-02-20 16:36 ` W. Trevor King
2013-02-20 17:23 ` Junio C Hamano
2013-02-23 15:27 ` [PATCH v2] " W. Trevor King
2013-02-23 21:21 ` Junio C Hamano
2013-02-23 21:35 ` W. Trevor King
2013-02-24 8:13 ` Junio C Hamano
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=7vliak6xop.fsf@alter.siamese.dyndns.org \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=trast@student.ethz.ch \
--cc=wking@tremily.us \
/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.