This repo's hook was 257 lines of shell, 207 of which were identical to the manager's. It is a 55-line stub now: find an interpreter, hand over stdin. The rules live in invisible_core.hooks, which this repo pins exactly, so there is one implementation instead of three copies that drifted nine ways. What this repo wants gated is declared in pyproject under [tool.invisible.hooks] - the suite, the core pin, and v* as the release tag prefix. The block is required rather than defaulted. scripts/install_hooks.py is new here. It lived only in the core, so this repo shipped a hook that nothing armed and nothing checked was armed: a fresh clone pushed with every gate inert and said nothing about it. A test now fails in an unarmed clone. test_the_pre_push_hook_gates_release_tags used to read the hook's text for a module name and a tag pattern, which made it a copy of the shell it was checking - red once when the hook swapped a glob for a regex, red again when the policy moved out of the shell, both times against a correct hook. It drives the real policy now and checks the gate ran for THIS project. .gitattributes pins the hook to LF so a Windows clone cannot produce a shell script its own shebang dies on.
16 lines
822 B
Plaintext
16 lines
822 B
Plaintext
# The pre-push hook is a shell script, and git must never hand it to a POSIX
|
|
# shell with CRLF line endings: `/bin/sh^M: bad interpreter` is how a gate stops
|
|
# running on a machine where nothing else looks wrong. This repo is developed on
|
|
# Windows with core.autocrlf=true, so without this line a fresh Windows clone
|
|
# gets CRLF in the working tree - and Git-for-Windows' sh is the one that runs it.
|
|
#
|
|
# The index has always stored LF, so a Linux clone was never affected. That is
|
|
# exactly why this was worth pinning rather than leaving to a default that
|
|
# happens to be right today.
|
|
.githooks/** text eol=lf
|
|
|
|
# The publish ledger is compared byte for byte across an autocrlf checkout and a
|
|
# Linux one. The gate folds CRLF vs LF deliberately, but there is no reason to
|
|
# make it do that work.
|
|
PUBLISHED.json text eol=lf
|