Skip to content

feat(hooks)!: remove post-commit hook from product (#167) - #169

Merged
dreamlx merged 1 commit into
masterfrom
feat/167-remove-post-commit-hook
Aug 15, 2026
Merged

feat(hooks)!: remove post-commit hook from product (#167)#169
dreamlx merged 1 commit into
masterfrom
feat/167-remove-post-commit-hook

Conversation

@dreamlx

@dreamlx dreamlx commented Aug 15, 2026

Copy link
Copy Markdown
Owner

What

产品级移除 post-commit hook(#167 决议:直接删,不留 deprecate 版)。

-1360 / +78 行。删除面:

  • cli_hooks.py(888→638):_generate_post_commit_scriptrun_post_commit_hook(tree-aware seam)、_maybe_warn_post_commit_disabled(GH bug(hooks install): yaml enabled: false 时仍打 ✓ 不警示 — 用户以为装好实际没动 #87 提示)、隐藏 hooks runhooks rerunSUPPORTED_HOOKS 收敛为 pre-commit + pre-push
  • config.pyPostCommitConfig / HooksConfig 整体删除
  • config_help.py / init_wizard.py / cli_config.py:hooks.post_commit 参数、yaml 生成块、WizardResult 字段
  • claude-md 注入模板(en/zh):rerun escape-hatch 行移除,scan-all --retry-all 保留
  • 测试:删 4 份(test_hook_post_commit / test_hooks_config / test_hooks_rerun / test_hooks_run_hidden),BDD feature 场景 + step 清理
  • 文档:git-hooks-integration.md 重写(含迁移说明)、README / configuration / advanced-usage / team-workflow / examples 同步;historical release notes / ADR 不动

Why

刷新时机策略归编排者/消费者,codeindex 收敛为 stateless 生成器(ADR-007 延伸):

Migration

  • 装过 hook 的用户:codeindex hooks uninstall post-commit(命令保留做存量清理)
  • 要新鲜索引:codeindex scan-all(结构秒级;--ai 有 cache)
  • 旧 wrapper 调用已删的 hooks run → 报错被 wrapper 的 || true 吞入 log,git 不受影响

Test

Closes #167

Refresh policy belongs to the orchestrator/consumer, not the generator:
- graph path: loomgraph index already re-exports every run
- README_AI path: release-time / manual scan-all (see #166)

Removed: hooks install post-commit, hidden 'hooks run', 'hooks rerun',
hooks.post_commit config section (5 modes), GH#87 install warning,
_enable warning, loop-guard/tree-aware seam machinery and tests.
'uninstall post-commit' still accepted for leftover cleanup.

BREAKING CHANGE: users with the hook installed → 'codeindex hooks
uninstall post-commit'; refresh indexes via 'codeindex scan-all'.
@dreamlx
dreamlx merged commit bf619ad into master Aug 15, 2026
8 checks passed
@dreamlx
dreamlx deleted the feat/167-remove-post-commit-hook branch August 15, 2026 14:09
dreamlx added a commit that referenced this pull request Aug 15, 2026
P1 (docs, #169 residual): active user-facing surfaces still advertising
the removed post-commit workflow — codeindex init's final output,
README_zh.md (bullet/workflow/skill-table; EN was clean),
examples/ai-integration-guide.md (whole Post-commit section + doc-only
scenario), team-workflow-guide ('Three hooks'). All removed/updated;
version-history mentions intentionally kept.

P2 (#171): _has_js_test_files walked .venv and duplicated the skip-set —
now shares _WALK_SKIP_DIRS with detect_languages (venv/.tox/.eggs
pruned), uncapped-walk rationale documented.

P2 (#172): leftover-hook read_text now catches OSError — status is
informational, must not crash on an unreadable file.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

arch: 刷新职责归属——loomgraph 编排重建,codeindex 收敛为 stateless 生成器(KISS 推论)

1 participant