Skip to content

git-hook enforcement silently dead: dangling pre-push symlink into deleted worktree; no pre-commit installed under explicit core.hooksPath #11598

Description

@mrveiss

Discovered while fixing the Stop-hook permission error. core.hooksPath=/home/martins/AutoBot-Ai/AutoBot-AI/.git/hooks (explicit, absolute — also violates machine portability). In that directory: pre-push is a symlink to .worktrees/issue-5142-hooks/tools/git-hooks/pre-push — the worktree is long deleted, so the symlink dangles and pre-push protection silently never runs. There is NO pre-commit file at all, so the documented protected-branch/worktree-only commit enforcement (CLAUDE_GIT.md) is not active either. Needs: an idempotent hook installer (likely from scripts/hooks/ templates) that installs real files (not worktree symlinks), plus verification that branch-guard actually blocks a main-tree commit. Related: #11581, #11593.

Activity

  1. github-actions commented on Jul 18, 2026

    @github-actions
    Contributor

    PR #11914 (merged to Dev_new_gui) references this issue with a close keyword.

    fix(hooks): idempotent portable git-hook installer + pre-commit branch-guard (#11598)

    If this issue is fully resolved, close it manually. If work remains, no action is needed.

  2. mrveiss commented on Jul 18, 2026

    @mrveiss
    OwnerAuthor

    Closed — merged to Dev_new_gui via #11914 (squash 2c43eca). Fix: new idempotent, machine-portable scripts/install-git-hooks.sh installs REAL hook files (not worktree symlinks), normalizes bad absolute core.hooksPath, replaces dangling symlinks, and PRESERVES a pre-commit-framework-managed hook (warn+skip) so the full quality suite isn't clobbered; standalone pre-commit branch-guard is the fallback when the pre-commit binary isn't installed. Verified in throwaway temp repos: main/master commits blocked (exit 1), Dev_new_gui/issue-* allowed, idempotent re-run, framework hook preserved. Discoveries: none.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions