Home

dev / openkara

publicthedavidweng/OpenKara· sync paused
Overview Code History Branches Pull requestsIssuesInsights
main
HomeOverview Code PRsIssues

fix(hooks): skip the pre-push gates when a push only deletes remote refs (#257)

2 months ago

fa5cadc
Authored
Davy7/26/2026, 6:46:12 AM
A 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

2 files changed
  • lefthook.yml+14−4
  • scripts/git-hooks/skip-delete-only-push.sh+33−0