beads/.githooks
Bee 2e6289f9fb
fix(hooks): key the push-time suite on the remote ref, never on the local ref's shape (#7352)
Since #7348 the pre-push hook ran scripts/pre-push-suite.sh only for stdin
lines whose local ref matched refs/heads/*. For `git push origin HEAD` and
`HEAD:refs/heads/x` git passes the literal local ref HEAD, so the suite never
ran for those pushes: a Go change pushed that way landed with an empty bazel
log, while the same change pushed as `git push origin br1` was refused.

The hook now skips a line when the remote ref is refs/tags/* or the local sha
is the zero sha (a deletion); everything else is a branch push, HEAD included.

TestPrePushHookSuiteKeysOnRemoteRef feeds the real hook HEAD-sourced ref lines
from a scratch repository with a stub suite that records whether it ran: both
HEAD forms run it on a Go change; a docs-only push, a tag pushed by HEAD or by
name, and a deletion do not. On main's hook the two HEAD cases fail.

TestPrePushHookRunsSuiteOnlyForGoChanges indexed "pre-push-suite.sh", which
the hook's header comment on line 3 also contains, so the ordering assertion
held wherever the call block sat. It now indexes the call line; moving the
suite block after the managed beads section fails it.

Fixes #7351

Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-08 07:49:57 +00:00
..
post-checkout Accept uutils coreutils timeout in generated hooks, and check the shims against real implementations (#6561) 2026-09-27 03:38:45 -07:00
post-merge Accept uutils coreutils timeout in generated hooks, and check the shims against real implementations (#6561) 2026-09-27 03:38:45 -07:00
pre-commit ci(bazel): nogo replaces go vet and golangci-lint (ga-96smfk.18) (#7341) 2026-10-07 05:17:22 +00:00
pre-push fix(hooks): key the push-time suite on the remote ref, never on the local ref's shape (#7352) 2026-10-08 07:49:57 +00:00
prepare-commit-msg Accept uutils coreutils timeout in generated hooks, and check the shims against real implementations (#6561) 2026-09-27 03:38:45 -07:00