Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add server-side hook: proc-receive #1775

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions book/08-customizing-git/sections/hooks.asc
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,16 @@ The first script to run when handling a push from a client is `pre-receive`.
It takes a list of references that are being pushed from stdin; if it exits non-zero, none of them are accepted.
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.

===== `proc-receive`

The `proc-receive` script is quite different from other server-side scripts.
It is invoked by git push process, but can change the worklow or process between `pre-receive` and `post-receive` script.
If the incoming update references match the specified reference pattern (`receive.procReceiveRefs`), then `proc-receive` will take over the whole flow after `pre-receive`.
It can decide to create, update or rename new reference, or even fall back to previous process.

In other words, it can outsource reference processing flow.
This gives a system administrator the ability to customize a pushing workflow, like that used in a Gerritt project.

===== `update`

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.
Expand Down