fix(setup): Keep Codemap state locally ignored - #128
Conversation
|
Reviewed. The write path is genuinely careful and I like the core decision: it writes to Verified across 15 disposable repos with byte-level before/after: fresh repo with no One thing I'd fix before merging.
|
3f107fb to
2b09e27
Compare
Write .codemap/ to the clone-local .git/info/exclude instead of a tracked .gitignore, so setup and config init never touch tracked files. doctor now verifies the effective ignore state, reporting OK whenever git ignores .codemap/ by any mechanism and failing only when it is genuinely unignored. The write is idempotent and a no-op outside a git work tree. Co-Authored-By: GPT-5.6 Sol <codex@openai.com>
2b09e27 to
9d2ff8f
Compare
|
Thanks for the review — all six points are addressed, with a couple of small extras. Confirmed, as reviewed:
Also changed:
|
JordanCoin
left a comment
There was a problem hiding this comment.
All three findings verified fixed.
Doctor now reports the effective state — OK local Codemap ignore: effective via .gitignore:12:.codemap/ on this repo — and still MISSes a genuinely unignored repo, so the check wasn't gutted to make the failure go away. It also handles a non-git directory (gates off silently rather than reporting something misleading) and a repo with no commits.
hasIgnoreLine moved to bytes.Split, so a 70KB line in .git/info/exclude no longer makes an existing entry read as absent — idempotency holds at exactly one entry across repeated runs. And appendIgnoreEntry now goes through writeFileAtomic, so a symlinked exclude gets replaced rather than written through, and there's no truncate-then-write window.
The repair hint is also now the minimal --no-hooks --no-mcp --no-config form rather than a full setup. Thanks for taking all of it.
What does this PR do?
Writes
.codemap/to the clone-local.git/info/exclude(shared by linked worktrees, submodule-local) instead of a tracked.gitignore, sosetupandconfig initnever touch tracked files.codemap doctorverifies the effective ignore state: OK whenever git ignores.codemap/by any mechanism, MISS only when it is genuinely unignored, with a minimal repair hint.Type of change
Checklist
go build && ./codemap .Additional notes
info/excludeonly when the entry is missing: idempotent, no duplicate on re-run, never creates a.gitignore.codemap setup --no-hooks --no-mcp --no-configso fixing the ignore rule does not rewrite hooks or MCP config.Developed with carefully directed, manually reviewed AI assistance.