No pre-push hook: every gate in this repository runs only after the push has landed #32
Notifications
Due Date
No due date set.
Blocks
#33 Gate every push on cppcheck: 6 findings, all in src/error.c
andrew/libakerror
Reference: andrew/libakerror#32
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This repository has no pre-push hook, and no hooks directory of any kind. Every gate it
has -- build, ctest, coverage, mutation -- runs only after a push has already reached the
forge, so the first thing that tells you a commit is broken is a red pipeline and a runner
cycle spent.
Filed separately from the cppcheck work because it is a gap in its own right, and because
the cppcheck issue's "wire it into the pre-push hook" step has nowhere to go until this
exists.
Why it matters here
libakstdlib already solved this.
.githooks/pre-pushthere runs the default build with-Werrorplus ctest, the ASan/UBSan build plus ctest, and doxygen -- a few seconds all in-- and puts the slow mutation harness behind
AKSL_HOOK_MUTATION=1. It is worth readingbefore writing this one; most of the decisions are already made and commented there:
.git/, so the hook never disturbs the developer's ownbuild/.fails closed on a missing optional tool only teaches everyone to pass
--no-verify.git push --no-verifyremains the escape hatch, and the hook says so when it aborts.What to build
.githooks/pre-push, modelled on libakstdlib's, installed withgit config core.hooksPath .githooks.scripts/cppcheck.sh(2--6 s, once the cppcheckissue lands), the default build plus ctest, and the
AKERR_USE_STDLIB=OFFbuild plusctest -- that configuration is a CI job here and is exactly the kind of thing that
breaks without anyone noticing locally.
variable, the way
AKSL_HOOK_MUTATIONdoes.git config core.hooksPathline in README.md or AGENTS.md.A hook nobody installs is not a gate.
Known limit, worth stating up front
core.hooksPathis per-clone local configuration. Git cannot install a hook for you, sothis gate is advisory by construction and CI stays the hard gate. That is the accepted
tradeoff, not a defect in the design -- the hook exists to make the failure cheap, not to
make it impossible.
Beginning work on issue #32.
Beginning work on the pre-push hook and installation documentation. I will model the gate ordering and failure behavior on libakstdlib, then verify the hook and repository tests.
Work is complete and ready for review.
Added the executable .githooks/pre-push gate, optional cppcheck handling, default and AKERR_USE_STDLIB=OFF build/test gates, opt-in mutation testing, isolated logs/builds, and README installation guidance. Verified shell syntax, delete-only behavior, and a simulated update push with both configurations passing.
Pull request: #34