From: Junio C Hamano Date: Tue, 19 Feb 2013 17:05:58 GMT Subject: Re: [PATCH] Documentation/githooks: Explain pre-rebase parameters Message-ID: <7vliak6xop.fsf@alter.siamese.dyndns.org> In-Reply-To: <878v6ksars.fsf@pctrast.inf.ethz.ch> Thomas Rast 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.