@@ -97,16 +97,31 @@ send out a commit notification e-mail.
9797update
9898------
9999
100- This hook is invoked by `git-receive-pack`, which is invoked
101- when a `git push` is done against the repository. It takes
102- three parameters, name of the ref being updated, old object name
103- stored in the ref, and the new objectname to be stored in the
104- ref. Exiting with non-zero status from this hook prevents
105- `git-receive-pack` from updating the ref.
106-
107- This can be used to prevent 'forced' update on certain refs by
100+ This hook is invoked by `git-receive-pack` on the remote repository,
101+ which is happens when a `git push` is done on a local repository.
102+ Just before updating the ref on the remote repository, the update hook
103+ is invoked. It's exit status determins the success or failure of
104+ the ref update.
105+
106+ The hook executes once for each ref to be updated, and takes
107+ three parameters:
108+ - the name of the ref being updated,
109+ - the old object name stored in the ref,
110+ - and the new objectname to be stored in the ref.
111+
112+ A zero exit from the update hook allows the ref to be updated.
113+ Exiting with a non-zero status prevents `git-receive-pack`
114+ from updating the ref.
115+
116+ This hook can be used to prevent 'forced' update on certain refs by
108117making sure that the object name is a commit object that is a
109118descendant of the commit object named by the old object name.
119+ That is, to enforce a "fast forward only" policy.
120+
121+ It could also be used to log the old..new status. However, it
122+ does not know the entire set of branches, so it would end up
123+ firing one e-mail per ref when used naively, though.
124+
110125Another use suggested on the mailing list is to use this hook to
111126implement access control which is finer grained than the one
112127based on filesystem group.
@@ -115,20 +130,30 @@ The standard output of this hook is sent to /dev/null; if you
115130want to report something to the git-send-pack on the other end,
116131you can redirect your output to your stderr.
117132
133+
118134post-update
119135-----------
120136
121- This hook is invoked by `git-receive-pack`, which is invoked
122- when a `git push` is done against the repository. It takes
123- variable number of parameters; each of which is the name of ref
124- that was actually updated.
137+ This hook is invoked by `git-receive-pack` on the remote repository,
138+ which is happens when a `git push` is done on a local repository.
139+ It executes on the remote repository once after all the refs have
140+ been updated.
141+
142+ It takes a variable number of parameters, each of which is the
143+ name of ref that was actually updated.
125144
126145This hook is meant primarily for notification, and cannot affect
127146the outcome of `git-receive-pack`.
128147
148+ The post-update hook can tell what are the heads that were pushed,
149+ but it does not know what their original and updated values are,
150+ so it is a poor place to do log old..new.
151+
129152The default post-update hook, when enabled, runs
130153`git-update-server-info` to keep the information used by dumb
131- transport up-to-date.
154+ transports (eg, http) up-to-date. If you are publishing
155+ a git repository that is accessible via http, you should
156+ probably enable this hook.
132157
133158The standard output of this hook is sent to /dev/null; if you
134159want to report something to the git-send-pack on the other end,
0 commit comments