fix(gbrain-sync): append .gbrain-source to consumer repo's .gitignore after attach#1501
Open
NikhileshNanduri wants to merge 1 commit into
Conversation
… after attach Closes garrytan#1384. The v1.29.0.0 changelog promised that .gbrain-source would be added to the consuming repo's .gitignore; the original patch only added it to gstack's own .gitignore. Conductor sibling worktrees sharing the same repo+branch would overwrite each other's per-worktree pin on every pull. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.
Summary
Fixes #1384.
The v1.29.0.0 changelog explicitly promised:
The original patch only added
.gbrain-sourceto gstack's own.gitignore. Consumer repos were never updated, so the pin file shows up as an untracked file and can get committed accidentally, silently overwriting other Conductor sibling worktrees' per-worktree source IDs on next pull.This patch adds the entry idempotently to the consumer repo's
.gitignoreimmediately after a successfulgbrain sources attach, insiderunCodeImport. The write is wrapped in a non-fatal try/catch so read-only checkouts don't fail the whole stage.What changed
bin/gstack-gbrain-sync.ts: aftergbrain sources attachsucceeds, append.gbrain-sourceto<root>/.gitignoreif not already present.Test plan
/sync-gbrainin a repo with no existing.gbrain-sourceline in.gitignore— line is appended after attach/sync-gbrainagain in the same repo — line is NOT duplicated (idempotent)/sync-gbrainin a repo with no.gitignore— file is created with.gbrain-sourcebun test(doc-inventory and Supabase failures are pre-existing on main)🤖 Generated with Claude Code