You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
post-commit hook overwrites .graphify_root, silently expanding a scoped build to the whole repo #1173
After a scoped build (graphify src/), installing the post-commit hook (graphify hook install) causes the next commit to re-extract all changed code files via git diff, ignoring the scoped src/ boundary, and overwrites .graphify_root from .../src to . (repo root). The graph silently expands beyond the user's intended scope, and there is no warning.
First commit that includes new scripts/*.py and *.ts (outside src/).
Hook auto-rebuilds. Result:
.graphify_root is overwritten to . (1 byte).
Graph grows to 374 nodes / 667 edges / 30 communities — scripts/ was absorbed.
Why this is surprising / hard to detect
The user explicitly scoped to src/, yet scripts/ ends up in the graph after a single commit. ("Why did scripts/ enter the graph when I only built src/?")
mtime-based staleness checks cannot catch it: graph.json mtime is fresh — what changed is the coverage scope, not freshness.
Suggested directions
The hook should respect an existing .graphify_root (not overwrite it), restricting the git diff re-extraction to the scoped root.
Or, if the whole-repo behavior is intended, warn at graphify hook install time that the hook re-extracts the entire repo on every commit and will override a scoped root.
Optionally a graphify hook install --respect-root flag.
Fixed in 6a549e4. Post-commit and post-checkout hook bodies now read graphify-out/.graphify_root before calling _rebuild_code, falling back to Path('.') if absent. A scoped build (graphify src/) no longer gets silently expanded to the full repo on the next commit.
Activity
fix: four bugs — affected direction, hook root, glob fish/zsh, manife…
safishamsi commentedon Jun 7, 2026
Fixed in 6a549e4. Post-commit and post-checkout hook bodies now read
graphify-out/.graphify_rootbefore calling_rebuild_code, falling back toPath('.')if absent. A scoped build (graphify src/) no longer gets silently expanded to the full repo on the next commit.fix: four bugs — affected direction, hook root, glob fish/zsh, manife…