Repository navigation
feat: add pullMode option so pull can keep local-only files - #103
Open
Rahulsharma0810 wants to merge 1 commit into
Open
Rahulsharma0810 wants to merge 1 commit into
Rahulsharma0810 wants to merge 1 commit into
Conversation
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.
Closes #99
What
Adds a
pullModeoption toopencode-synced.jsonc:"replace"(default, unchanged behaviour): a synced directory is replaced by the repo copy, so local-only files inside it are deleted."merge": repo files are copied over local ones, and local-only files are left in place.mergeapplies to the default directory items and to directory entries inextraConfigPaths/extraSecretPaths. It is passed from the three places that callsyncRepoToLocal(link, pull, startup pull). Session items that use chunked orpreserveWhenMissinghandling are not affected.Why
copyItem()removes the destination directory before copying it, so any file that exists only locally insideagents/,commands/,plugins/,scripts/,skills/and so on is lost on pull. Machines that keep a few local-only files next to the synced ones had no way to avoid that.Compatibility
Default is
replace, so existing setups behave exactly as before. An unknown value falls back toreplace.Not included
Deletions made in the repo are not propagated in
mergemode. A manifest-based "delete only what we wrote" mode and a pre-replace backup were also suggested in #99; I left them out to keep this change small.Tests
apply.test.ts: default mode still removes local-only files, merge mode keeps them and still updates shared files.config.test.ts:pullModenormalization (default,merge, invalid value).bun run check,bun run test(209 passing) andbun run buildpass.