2 months ago
fa5cadcA deletion-only push transfers no commits, so the repo-wide gates have nothing
to verify — yet deleting a stale remote branch cost a full format + lint +
coverage run, which is exactly the friction that teaches people to reach for
--no-verify. Each gate now runs through a guard that reads git's pre-push ref
lines from stdin (a deletion is the zero local sha) and skips only when every
pushed ref is a deletion; a push that deletes and updates refs still runs
everything.
{push_files} could not express this: on a deletion-only push lefthook still
resolves it to the current branch's stale upstream diff, so the gates would
have run against unrelated files. The stdin route is exact, and its failure
mode is safe — if the use_stdin wiring is ever lost, the guard sees no input
and runs the gates.
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>Parent316ef50