Development record
banlist.hooks_path_armed reports false, in the bare ahoy status and in --json, when the committed .githooks/ hooks are reached through a global core.hooksPath dispatcher that chains to them: a false negative. hooksPathArmed (internal/core/ahoy/banlist_scaffold.go) reads only git config --local core.hooksPath and compares it to the clone's .githooks, so it cannot see a global hooks path, and it never asks whether the hook actually runs. Reproduced at tip with a scratch global gitconfig whose core.hooksPath names a dispatcher that runs <toplevel>/.githooks/pre-commit and then .git/hooks/pre-commit: 'git hook run pre-commit' ran abcd's name guard and exited 0, yet hooks_path_armed was false and the bare status said '(arm this clone: git config core.hooksPath .githooks)'. Following that advice sets a local core.hooksPath that overrides the person's global dispatcher in this clone, dropping whatever else it chains, so the false negative turns into harmful advice. Related: open iss-2609120447480903 proposes raising a gap on hooks_path_armed=false, which would make this a false gap.
banlist.hooks_path_armed reports false, in the bare ahoy status and in --json, when the committed .githooks/ hooks are reached through a global core.hooksPath dispatcher that chains to them: a false negative. hooksPathArmed (internal/core/ahoy/banlist_scaffold.go) reads only git config --local core.hooksPath and compares it to the clone's .githooks, so it cannot see a global hooks path, and it never asks whether the hook actually runs. Reproduced at tip with a scratch global gitconfig whose core.hooksPath names a dispatcher that runs <toplevel>/.githooks/pre-commit and then .git/hooks/pre-commit: 'git hook run pre-commit' ran abcd's name guard and exited 0, yet hooks_path_armed was false and the bare status said '(arm this clone: git config core.hooksPath .githooks)'. Following that advice sets a local core.hooksPath that overrides the person's global dispatcher in this clone, dropping whatever else it chains, so the false negative turns into harmful advice. Related: open iss-2609120447480903 proposes raising a gap on hooks_path_armed=false, which would make this a false gap.
Grounds
- pursued: a clone whose global core.hooksPath dispatcher chains to .githooks reads hooks_path=foreign and gets no local-override advice, while an unset clone still gets it; a fixture with such a global dispatcher printing 'arm this clone', or hooks_path reading unarmed, would show it wrong.
Frontmatter
| id | iss-2610020704152920 |
|---|---|
| type | issue |
| lifecycle | resolved |
| severity | minor |
.abcd/work/issues/resolved/iss-2610020704152920-banlist-hooks-path-armed-reports-false.md
open on GitHub ↗ · commit history ↗
mentions1
- iss-2609120447480903ahoy install writes .githooks/pre-commit but leaves 'git config core.hooksPath .githooks' to the user, so the hook is committed but not running on the clone that just installed it. Detection knows this (hooks_path_armed=false) yet emits no gap for it. Proposal: a user-state gap that arms the clone after checking .git/hooks has no non-sample hooks the redirect would bypass, refusing with a note when it does.