git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Documentation/githooks: Explain pre-rebase parameters
@ 2013-02-19 11:03 W. Trevor King
  2013-02-19 13:17 ` Thomas Rast
  2013-02-19 19:08 ` Junio C Hamano
  0 siblings, 2 replies; 11+ messages in thread
From: W. Trevor King @ 2013-02-19 11:03 UTC (permalink / raw)
  To: Git; +Cc: Junio C Hamano, W. Trevor King

From: "W. Trevor King" <wking@tremily.us>

Descriptions borrowed from templates/hooks--pre-rebase.sample.

Signed-off-by: W. Trevor King <wking@tremily.us>
---
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:

  $ man bash | grep '\${.*[+]'
              (${BASH_SOURCE[$i+1]})  where  ${FUNCNAME[$i]}  was  called  (or
              ${BASH_SOURCE[$i+1]}.
              ${BASH_SOURCE[$i+1]}  at  line  number  ${BASH_LINENO[$i]}.  The
       ${parameter:+word}

In my local tests, it seems equivalent to "$@".

Also, it appears that the `git-rebase--*.sh` handlers don't use the
pre-rebase hook.  Is this intentional?

Cheers,
Trevor

 Documentation/githooks.txt | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/Documentation/githooks.txt b/Documentation/githooks.txt
index b9003fe..bc837c6 100644
--- a/Documentation/githooks.txt
+++ b/Documentation/githooks.txt
@@ -140,9 +140,10 @@ the outcome of 'git commit'.
 pre-rebase
 ~~~~~~~~~~
 
-This hook is called by 'git rebase' and can be used to prevent a branch
-from getting rebased.
-
+This hook is called by 'git rebase' and can be used to prevent a
+branch from getting rebased.  The hook takes two parameters: the
+upstream the series was forked from and the branch being rebased.  The
+second parameter will be empty when rebasing the current branch.
 
 post-checkout
 ~~~~~~~~~~~~~
-- 
1.8.1.336.g94702dd

^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2013-02-24  8:13 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).