Documentation
¶
Overview ¶
Package hooks owns the bare-repo hook installation contract used by the push pipeline (S14). pre-receive and post-receive are tiny shell shims that re-invoke shithubd. They're symlinks so a binary upgrade doesn't require touching every repo's hooks directory.
Why shell shims and not direct symlinks to the binary: git invokes the hook with stdin piped and a particular cwd, and the shim lets us preserve the env (the SHITHUB_* vars set by S12/S13) while routing to a stable subcommand interface. The shim is generated once at install time; we don't depend on its file path matching the binary.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var SupportedHooks = []string{"pre-receive", "post-receive"}
SupportedHooks is the canonical list of hooks the push pipeline owns. Add new hook names here and they'll be installed on every repo init.
Functions ¶
func Install ¶
Install (re)installs every supported hook on the bare repo at gitDir. shithubdPath is the absolute path to the shithubd binary the shim should invoke. Permissions are forced to 0o755 (owner: rwx; group + other: rx) — git refuses to run hooks lacking the executable bit.
Install is idempotent: re-running on a repo that already has up-to- date hooks is a no-op. If a hook file exists but doesn't match the expected shim, it's overwritten.
Types ¶
This section is empty.