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

2013-02-20 Thread Junio C Hamano
"W. Trevor King" writes: > Since $upstream_arg will always be set, would it make sense to change > the `${1+"$@"}` syntax in run_pre_rebase_hook() to a plain "$@"? I suspect that there no longer is a need for ${1+"$@"} in today's world even when you do not have arguments, and it certainly is fin

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

2013-02-20 Thread W. Trevor King
On Tue, Feb 19, 2013 at 11:08:29AM -0800, Junio C Hamano wrote: > "W. Trevor King" writes: > > Also, it appears that the `git-rebase--*.sh` handlers don't use the > > pre-rebase hook. Is this intentional? > > The codeflow of git-rebase front-end, when you start rebasing, will > call run_pre_reba

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

2013-02-19 Thread Junio C Hamano
"W. Trevor King" writes: > From: "W. Trevor King" > > Descriptions borrowed from templates/hooks--pre-rebase.sample. > > Signed-off-by: W. Trevor King > --- > I'm not 100% convinced about this, because the git-rebase.sh uses: > > "$GIT_DIR/hooks/pre-rebase" ${1+"$@"} > > I haven't been able t

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

2013-02-19 Thread Junio C Hamano
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 i

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

2013-02-19 Thread W. Trevor King
On Tue, Feb 19, 2013 at 02:17:43PM +0100, Thomas Rast wrote: > "W. Trevor King" writes: > > I haven't been able to find documentation for the ${1+"$@"} syntax. > > Is it in POSIX? It's not in the Bash manual: > [...] > > In my local tests, it seems equivalent to "$@". > > It's definitely in the

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

2013-02-19 Thread Thomas Rast
"W. Trevor King" writes: > I'm not 100% convinced about this, because the git-rebase.sh uses: > > "$GIT_DIR/hooks/pre-rebase" ${1+"$@"} > > I haven't been able to find documentation for the ${1+"$@"} syntax. > Is it in POSIX? It's not in the Bash manual: [...] > In my local tests, it seems equ

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

2013-02-19 Thread W. Trevor King
From: "W. Trevor King" Descriptions borrowed from templates/hooks--pre-rebase.sample. Signed-off-by: W. Trevor King --- I'm not 100% convinced about this, because the git-rebase.sh uses: "$GIT_DIR/hooks/pre-rebase" ${1+"$@"} I haven't been able to find documentation for the ${1+"$@"} syntax