Thread (1 message) 1 message, 1 author, 2016-06-15

Re: [PATCH] Documentation/githooks: Explain pre-rebase parameters

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:56:12

Thomas Rast [off-list ref] writes:
quoted
  "$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.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help