Summary
graphify builds its ignore set only from .gitignore and .graphifyignore (detect.py, _load_graphifyignore iterates exactly (".gitignore", ".graphifyignore")). It does not read .git/info/exclude — the standard place git records git-worktree paths and local-only excludes. As a result graphify walks into git-worktree directories nested under the repo (each a full second copy of the codebase) and the graph explodes.
Repro
- A repo with git worktrees checked out under it, e.g.
worktrees/foo, excluded via .git/info/exclude (not .gitignore).
graphify update . (or the graphify hook install auto-rebuild hooks) walks into worktrees/* and indexes every copy.
In my case (5 worktrees) the graph went from ~9,400 nodes / 10 MB to ~210,000 nodes / 311 MB — ~77% duplicate worktree nodes, near the 512 MB graph.json cap — and it was regenerated on every commit by the auto-rebuild hooks.
Version
graphifyy 0.9.12
Suggested fix
Include .git/info/exclude in the ignore set (or, more robustly, defer to git check-ignore semantics when inside a git repo). At minimum, document that only .gitignore / .graphifyignore are honored, so users know to add worktree dirs there.
Workaround
Add the worktree directory to .gitignore or .graphifyignore.
Summary
graphify builds its ignore set only from
.gitignoreand.graphifyignore(detect.py,_load_graphifyignoreiterates exactly(".gitignore", ".graphifyignore")). It does not read.git/info/exclude— the standard place git records git-worktree paths and local-only excludes. As a result graphify walks into git-worktree directories nested under the repo (each a full second copy of the codebase) and the graph explodes.Repro
worktrees/foo, excluded via.git/info/exclude(not.gitignore).graphify update .(or thegraphify hook installauto-rebuild hooks) walks intoworktrees/*and indexes every copy.In my case (5 worktrees) the graph went from ~9,400 nodes / 10 MB to ~210,000 nodes / 311 MB — ~77% duplicate worktree nodes, near the 512 MB
graph.jsoncap — and it was regenerated on every commit by the auto-rebuild hooks.Version
graphifyy 0.9.12
Suggested fix
Include
.git/info/excludein the ignore set (or, more robustly, defer togit check-ignoresemantics when inside a git repo). At minimum, document that only.gitignore/.graphifyignoreare honored, so users know to add worktree dirs there.Workaround
Add the worktree directory to
.gitignoreor.graphifyignore.