Help us shape the future of Go! Take the 2026 Go Developer Survey

hooks

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 10, 2026 License: AGPL-3.0 Imports: 3 Imported by: 0

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

View Source
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

func Install(gitDir, shithubdPath string) error

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL