ref:main

Add post-receive and update hook support #9

closed Opened by cole.christensen@gmail.com

Links

No links yet.

Problem

Only pre_receive_hook is implemented in receive-pack. There is no support for update (per-ref) or post-receive (after successful update) hooks. These are essential for triggering downstream actions.

Impact

  • Cannot trigger CI pipelines on push
  • Cannot send notifications on ref updates
  • Cannot implement per-ref authorization (update hook)
  • Limits usefulness as a git hosting server

Acceptance Criteria

  • update hook: called per-ref with (ref, old_sha, new_sha), can reject individual refs
  • post_receive hook: called after all refs updated, receives list of changes
  • Hooks are pluggable functions (same pattern as existing pre_receive_hook)
  • Hook failures in update reject only the affected ref, not the entire push
  • post_receive failures are logged but don’t affect the push result
  • Tests for each hook type including partial rejection scenarios