Repository navigation
fix(docs): correct a false claim about local git hooks, and log how it got in - #29
Merged
Merged
Conversation
…t got in The claim that a repository pre-commit is dead on this machine was wrong. core.hooksPath does redirect and git itself never reads .git/hooks — both true — but the occupying ggshield script ends by calling $(git rev-parse --git-common-dir)/hooks/pre-commit and failing the commit if it fails. The slot is chained, not occupied. Measured by reading the file, which is what nobody had done. The decision does not move: CI still wins for the two reasons that were never about the slot — .git/hooks is not versioned and does not survive a clone, and --no-verify walks past any local hook including for whoever merges the PR introducing the defect. The LEARNINGS lesson is sharpened rather than removed: occupancy is not a second question, it answers the first. Whether your control runs is a property of the occupant's code, not of the configuration pointing at it. Both halves bite — read it and you learn your hook is reachable after all; skip it and you can destroy a working guard while reading as installed. Logged in AGENT-EVALS: the premises were all checked and all true, and the inference drawn from them was adopted without opening the file it was about. Verification on the premises is agreement with extra steps. See CHANGELOG [Unreleased] > Changed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A fact recorded this morning was wrong. It is corrected, the decision it supported is unchanged, and the way it got in is logged.
The correction
A repository
pre-commitis dead on this machine — false. Two true things led there:core.hooksPathdoes redirect globally, and git itself never falls back to.git/hooks. But the occupying script ends with:It calls the repository's hook and fails the commit if that fails. The slot is chained, not occupied. Verified by reading the file rather than by relaying the correction.
The decision does not move
CI still wins, for the two reasons that were never about the slot:
.git/hooks/is not versioned and does not survive a clone, and--no-verifywalks past any local hook — including for whoever merges the PR that introduces the defect, which is how the original omission arrived.The lesson is sharpened, not removed
Occupancy is not a second question — it answers the first. Whether your control runs is a property of the occupant's code, not of the configuration pointing at it: here the configuration said unreachable and the script said I call it myself. Both halves bite. Read it and you learn your hook is reachable after all. Skip it and you can destroy a working guard while reading as installed — which writing into the
ggshielddirectory itself, where the entries are symlinks intodotfilesbeside a.bak-from a previous overwrite, still would have done.How it got in
Logged in
docs/AGENT-EVALS.md. The claim came from a peer with its evidence. The evidence was checked — the redirect, the directory listing,git rev-parse --git-path hooks— and all of it was true. The inference was adopted, and the file it concerned was never opened.That is a variant of asserts without verifying that survives the usual guard, because verification happened, on the premises. Checking every fact someone measured and adopting their conclusion is agreement with extra steps, and it feels like diligence. The tell: the conclusion concerned the behaviour of a file whose path had been confirmed three ways.