fix(gitignore): refresh managed block on upgrade#2
Merged
Conversation
appendGitignore returned early when the marker already existed, so an existing install upgraded to a newer kit kept its stale managed block — ignore rules added later (`.gitnexus/`, `.agents/skills/`, the tracked `.gnkit/skills` store scheme) were never applied. Old installs silently missed the "distribute skills via git" gitignore changes. Now the managed block is stripped and rewritten from the current snippet on every install/update (additions and removals both propagate), preserving surrounding user content and staying idempotent. Refactor removeGitignoreSnippet to share the same block-strip helper. Verified on a real v1.1.0 install (enter-control): block refreshed to ignore the index + all IDE skill symlink dirs while the .gnkit/skills store stays trackable. Ports a fix from the discarded main-based branch. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
ReidenXerx
added a commit
that referenced
this pull request
Jul 16, 2026
…tion Task-core compaction migration (intel routine #2)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
appendGitignorereturned early when the.gitignoremarker already existed:So a repo installed with an older kit version kept its stale managed block on upgrade. Ignore rules added later —
.gitnexus/(graph index),.agents/skills/, and the "distribute skills via git" scheme — were never applied to existing installs. The.gnkit/skillsstore distribution feature silently failed for anyone who installed before it landed.Found while auditing whether
mainlost any fixes from a discarded parallel branch — this one it did.Fix
Strip and rewrite the managed block from the current snippet on every install/update, so both additions and removals propagate. Preserves surrounding user content, stays idempotent, and
removeGitignoreSnippetnow shares the same block-strip helper.Verified
.gitnexus/+.agents/skills/+.claude/skills/, keeps user lines, no duplicate marker. 54/54 tests pass.enter-control(a v1.1.0 install) — block refreshed so the index + all IDE symlink dirs are ignored while.gnkit/skillsstays trackable; the previous?? .agents/skills/*untracked noise is gone.🤖 Generated with Claude Code