scripts/hooks/ has a pre-commit hook but no pre-push hook #82
Notifications
Due Date
No due date set.
Blocks
Reference: andrew/libakgl#82
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 a hooks directory --
scripts/hooks/, installed withgit config core.hooksPath scripts/hooks-- but the only hook in it ispre-commit, whichreindents staged C sources. There is no pre-push hook, so every real gate this repository
has (build with
-Werror, ctest, doxygen, the benchmark budgets, valgrind, mutation) runsonly after a push has already reached the forge.
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 is cheap to build here
Cheaper than in akbasic or libakerror, which have no hook infrastructure at all: the
directory exists,
core.hooksPath scripts/hooksis already the documented install line,and anyone with the pre-commit hook working gets a pre-push hook the moment it lands, with
no second instruction to follow.
libakstdlib already solved the hard part.
.githooks/pre-pushthere runs the default buildwith
-Werrorplus ctest, the ASan/UBSan build plus ctest, and doxygen -- a few seconds allin -- 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.scripts/hooks/pre-commitis the other model to follow, for the local conventions:shrather than bash,
set -eu, leave merge resolution alone, and warn-and-skip rather thanfail when an optional tool is absent.
What to build
scripts/hooks/pre-push, alongside the existingpre-commit.scripts/cppcheck.sh(2 s measured, once thecppcheck issue lands), then the
AKGL_WERROR=ONbuild plus ctest.scripts/memcheck.shand the mutation harness go behind environment variables --valgrind over every suite is not a per-push cost.
tests/benchutil.halready refuses to enforce budgets in an unoptimized build, and a budget measured on a
developer's busy laptop is not a measurement.
core.hooksPath scripts/hooksline nowinstalls two hooks, not one.
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 #82: I will add and validate the missing pre-push hook.
Beginning work on the pre-push hook and installation documentation.
Implementation is complete. The synthetic pre-push run reached the real configure step but cannot proceed in this environment because SDL3 development files are unavailable; shell syntax and diff checks pass.
Work is done. Pull request #84 is open, requests Andrew's review, and the ticket is labeled status::review: #84