1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# PyGitTools
Authentication, hooks, and pygit2 workflows used by PyGitWeb. Can be used headless for many purposes.
## Hook framework
`pygittools.hooks` provides a thin `Hook` base class plus one subclass per git hook type
(client- and server-side). Receive-pack hooks (`PreReceive`, `PostReceive`) parse their
ref-update lines via `parse_ref_updates(stdin)`.
`pygittools.hooks_notify` adds `PreReceiveNotify` / `PostReceiveNotify`: minimal hook
variants that POST `?project=<name>` to a pygitweb `/_internal/notify` endpoint so its
long-poll `updates=true` subscribers wake up immediately on each push. Notification
failures never reject the push.
See `hook_samples/` for ready-to-use scripts.