Loading page...Загружаем страницу...正在加载页面...
AtlasRepo

Git said the commit succeeded. My hooks never ran.

Описание и применение

В репозиториях с Husky хуки не запускались в новых git worktree из‑за отсутствия исполняемых шимов. Добавлены скрипты проверки и восстановления хуков при старте сессии Cursor и мост для выполнения хуков в облачных агентах, что устраняет тихие пропуски.

Задача

Husky pre‑commit hooks were not executed in a git worktree because the worktree inherited the hooksPath but did not have the executable shims generated by Husky.

Результат

Hooks are now reliably detected, repaired, or flagged across worktrees and Cloud Agents, preventing silent skips and ensuring pre‑commit checks run as intended.

Рабочий процесс

  • Add git worktree; it inherits core.hooksPath but lacks Husky shims.
  • Commit in the worktree; Git accepts it without running hooks.
  • Detect missing shims via verify:git-hooks script during session start.
  • Repair missing shims if possible; warn with "HOOKS NOT RUNNABLE" if not.
  • Use Cursor hook bridge to route Git hook execution to the repository at commit time.
  • Ensure Cloud Agents wait for the bridge before starting work.
  • Package verification, repair, and lifecycle scripts into a marketplace plugin.
  • Wire scripts into each repository’s installation and session‑start lifecycle.
  • Monitor hook availability in each environment.

Доказательства

Husky still has to generate executable shims under .husky/_ in that worktree, and git worktree add does not do that step for you.

Источник

I moved hook verification and repair into shared scripts that run when a Cursor session starts.

Источник

Cloud Agents need another safeguard. Cursor's hook bridge routes Git hook execution to the current repository at commit time.

Источник

  • Дата записи: 2026-10-16T06:41:04.364Z