Merge branch 'wk/doc-pre-rebase'
authorJunio C Hamano <gitster@pobox.com>
Tue, 19 Mar 2013 19:14:05 +0000 (12:14 -0700)
committerJunio C Hamano <gitster@pobox.com>
Tue, 19 Mar 2013 19:14:05 +0000 (12:14 -0700)
* wk/doc-pre-rebase:
Documentation/githooks: Explain pre-rebase parameters

1  2 
Documentation/githooks.txt
index eab9b356cd67cff9221aec16b34204622f15116f,e711cf1a0154a37aae6644f654c5cedbd83e11aa..dc6693fe482e2311a7d0ed5b5e60abec7c150c0c
@@@ -3,7 -3,7 +3,7 @@@ githooks(5
  
  NAME
  ----
 -githooks - Hooks used by git
 +githooks - Hooks used by Git
  
  SYNOPSIS
  --------
@@@ -108,7 -108,7 +108,7 @@@ it is not suppressed by the `--no-verif
  means a failure of the hook and aborts the commit.  It should not
  be used as replacement for pre-commit hook.
  
 -The sample `prepare-commit-msg` hook that comes with git comments
 +The sample `prepare-commit-msg` hook that comes with Git comments
  out the `Conflicts:` part of a merge's commit message.
  
  commit-msg
@@@ -140,9 -140,11 +140,11 @@@ 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 may be called with one or
+ two parameters.  The first parameter is the upstream from which
+ the series was forked.  The second parameter is the branch being
+ rebased, and is not set when rebasing the current branch.
  
  post-checkout
  ~~~~~~~~~~~~~
@@@ -176,35 -178,6 +178,35 @@@ save and restore any form of metadata a
  (eg: permissions/ownership, ACLS, etc).  See contrib/hooks/setgitperms.perl
  for an example of how to do this.
  
 +pre-push
 +~~~~~~~~
 +
 +This hook is called by 'git push' and can be used to prevent a push from taking
 +place.  The hook is called with two parameters which provide the name and
 +location of the destination remote, if a named remote is not being used both
 +values will be the same.
 +
 +Information about what is to be pushed is provided on the hook's standard
 +input with lines of the form:
 +
 +  <local ref> SP <local sha1> SP <remote ref> SP <remote sha1> LF
 +
 +For instance, if the command +git push origin master:foreign+ were run the
 +hook would receive a line like the following:
 +
 +  refs/heads/master 67890 refs/heads/foreign 12345
 +
 +although the full, 40-character SHA1s would be supplied.  If the foreign ref
 +does not yet exist the `<remote SHA1>` will be 40 `0`.  If a ref is to be
 +deleted, the `<local ref>` will be supplied as `(delete)` and the `<local
 +SHA1>` will be 40 `0`.  If the local commit was specified by something other
 +than a name which could be expanded (such as `HEAD~`, or a SHA1) it will be
 +supplied as it was originally given.
 +
 +If this hook exits with a non-zero status, 'git push' will abort without
 +pushing anything.  Information about why the push is rejected may be sent
 +to the user by writing to standard error.
 +
  [[pre-receive]]
  pre-receive
  ~~~~~~~~~~~
@@@ -304,7 -277,7 +306,7 @@@ for the user
  
  The default 'post-receive' hook is empty, but there is
  a sample script `post-receive-email` provided in the `contrib/hooks`
 -directory in git distribution, which implements sending commit
 +directory in Git distribution, which implements sending commit
  emails.
  
  [[post-update]]
@@@ -332,7 -305,7 +334,7 @@@ them
  When enabled, the default 'post-update' hook runs
  'git update-server-info' to keep the information used by dumb
  transports (e.g., HTTP) up-to-date.  If you are publishing
 -a git repository that is accessible via HTTP, you should
 +a Git repository that is accessible via HTTP, you should
  probably enable this hook.
  
  Both standard output and standard error output are forwarded to
@@@ -365,7 -338,7 +367,7 @@@ preceding SP is also omitted.  Currentl
  'extra-info'.
  
  The hook always runs after the automatic note copying (see
 -"notes.rewrite.<command>" in linkgit:git-config.txt) has happened, and
 +"notes.rewrite.<command>" in linkgit:git-config.txt[1]) has happened, and
  thus has access to these notes.
  
  The following command-specific comments apply: