Skip to content

Commit e6649bf

Browse files
author
Li Linchao
committed
add server-side hook: proc-receive
1 parent 258c9a1 commit e6649bf

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

book/08-customizing-git/sections/hooks.asc

+8
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,14 @@ The first script to run when handling a push from a client is `pre-receive`.
111111
It takes a list of references that are being pushed from stdin; if it exits non-zero, none of them are accepted.
112112
You can use this hook to do things like make sure none of the updated references are non-fast-forwards, or to do access control for all the refs and files they're modifying with the push.
113113

114+
===== `proc-receive`
115+
116+
The `proc-receive` script is quite different from other server-side scripts, it is invoked by git push process, but can change the workflow or process between `pre-reveive` and `post-receive` hook.
117+
This's because if the upcoming update references match the specified reference pattern, which can be configured by `receive.procReceiveRefs`, then `proc-receive` will take over the whole flow
118+
after `pre-receive`, then ignore the `update` script. It can decide to create, update or rename new reference, or even fallback to previous process.
119+
In other word, it can outsource reference processing flow, this give a system administrator to customize very useful policy for pushing workflow, such as Gerrit-like workflow in native Git.
120+
This script runs once at push process, and can stop the push process.
121+
114122
===== `update`
115123

116124
The `update` script is very similar to the `pre-receive` script, except that it's run once for each branch the pusher is trying to update.

0 commit comments

Comments
 (0)