From 24080328c1d98054cb76ca38c4e4b97544a1cefb Mon Sep 17 00:00:00 2001 From: David F Glidden Date: Wed, 26 Aug 2026 18:19:01 +0200 Subject: [PATCH] [FIX] pre-commit: the refusal message stops recommending a mechanism this system retired MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The message told people to use Git LFS. Wrong twice: LFS cannot satisfy this check (it measures the working-tree file), and LFS was tried in this system and retired. Message drafted by the jurist, with two corrections to my draft that I would have shipped as written: (a) My version asserted "git.skemantix.com serves no LFS endpoint" — a PRESENT-TENSE substrate claim, inside a script global to 37 repos, that the hook cannot verify, that is repo-dependent across those remotes, and that nothing checks. PENDING-144's open class exactly. Now stated historically: a dated fact about what was tried does not go stale. (b) My version led the remedy with `git config --local core.hooksPath .githooks`. That does not exempt large files — it stops the global hook running in that repo AT ALL, taking every other check with it. Advertising it as the routine response to a routine refusal is REVIEWED-105's failure mode returning: someone runs the config line without copying the hook and now has an unguarded repo that looks governed. The remedy now leads with copying 400c054's hook and adding the exemption there; the config line is last. Controls re-run after the change: whitespace-named 6MB REFUSED (and printing the new message), plain 6MB REFUSED, small file COMMITTED. Disposition of PENDING-163's option (ii), recorded here because the ground matters more than the verdict: 0677e8a gives two reasons for retiring LFS with different lifespans. The endpoint reason is contingent — a repo pointing elsewhere changes it. The merits reason ("git delta-compresses text natively") is not, and it is now measured rather than quoted: eight commits of an append-only 4MB JSONL cost 6MB in plain git and 18MB under LFS, because LFS stores a whole opaque blob per version and cannot delta. THREE TIMES WORSE, on precisely the corpus that started this. (ii) therefore REJECTED on the merits, not deferred on the endpoint. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01NvZAKSf9aqratbqHbU9LK5 --- git/hooks/pre-commit | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/git/hooks/pre-commit b/git/hooks/pre-commit index a216261..6b8bf5b 100755 --- a/git/hooks/pre-commit +++ b/git/hooks/pre-commit @@ -56,8 +56,12 @@ while IFS= read -r -d '' file; do if [ -f "$file" ]; then size=$(wc -c < "$file") if [ "$size" -gt 5242880 ]; then - echo -e "${RED}Error: $file is larger than 5MB${NC}" - echo "Consider using Git LFS for large files" + echo -e "${RED}Error: $file is larger than 5 MiB (5,242,880 bytes)${NC}" + echo "This ceiling measures the working-tree file. Git LFS does not exempt it," + echo "and LFS was tried in this system and retired (chamber-library 0677e8a, 2026-06-05)." + echo "If this repo legitimately holds large files it needs its own hook:" + echo "copy .githooks from chamber-library (400c054), add the path exemption there," + echo "then: git config --local core.hooksPath .githooks" exit 1 fi fi