fix(lefthook): remove duplicate git-lfs pre-push command — resolves pre-push deadlock #23
Reference in New Issue
Block a user
Delete Branch "fix/lefthook-lfs-deadlock"
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?
Root cause
Lefthook v2 automatically runs
git lfs pre-pushfor every push when git-lfs is installed (perdocs/usage/features/git-lfs.md, confirmed ininternal/run/controller/lfs.go). Ourlefthook.ymlhad a manualgit-lfs:command running the same thing — a duplicate invocation. The internal call read buffered stdin and uploaded LFS objects cleanly; the manual call either hung on pseudo-TTY-without-EOF or got tangled with the Gitea LFS server on a redundant verify request.Historical context
Both tools are recent additions. Lefthook landed in WS-3 (April) for post-commit
.claude-sync/regeneration. Git-LFS landed in TEST-INFRA-001 (May, two days ago) for visual regression baseline PNGs. The deadlock surfaced only after both were active together — explains why the first weeks of project work had no issue.Fix
git-lfs:command fromlefthook.ymlpiped: true(placebo from earlier failed attempt commit1b06804—pipedis fail-fast semantics, not stdin/sequencing)sync-checkremains the only user-defined pre-push commandEmpirical verification
--no-verify. Exactly one[git-lfs] executing hookline in log; no duplicate. Confirms fix works against network-y remote where the hang originally manifested.Regression protection
dev-docs/ADR-LEFTHOOK-LFS-INTEGRATION.md— full investigation record + two named misconceptions:git lfs install --skip-repocomment in the originallefthook.ymlwas technically correct but conceptually misleading (the "delegate" framing was wrong)piped: truedoes NOT control sequencing or stdin routing (it's fail-fast semantics)scripts/test-lefthook-pre-push.sh— disposable-sandbox smoke test asserting exactly one internal LFS call, zero manual ones, LFS upload present. Run after anylefthook.ymlchange.What this does NOT touch
.githooks/pre-pushcontent unchanged (it's stdin-innocent, per Phase A finding A5)Post-merge
No special action. Future pushes work without
--no-verify. If the hang ever recurs: runscripts/test-lefthook-pre-push.shand consult the ADR's "Alternative scenarios" section.🤖 Generated with Claude Code