Repository navigation
Add apply --on-conflict, covering replace and update in tests - #11
Merged
Merged
Conversation
donnes
force-pushed
the
release-scripts
branch
from
October 21, 2026 16:22
c8af445 to
2c81214
Compare
donnes
force-pushed
the
conflict-flags
branch
from
October 21, 2026 16:22
08d1992 to
4e6a016
Compare
donnes
force-pushed
the
release-scripts
branch
from
October 21, 2026 16:27
2c81214 to
53b38cb
Compare
donnes
force-pushed
the
conflict-flags
branch
from
October 21, 2026 16:27
4e6a016 to
454a665
Compare
donnes
force-pushed
the
release-scripts
branch
from
October 22, 2026 07:38
53b38cb to
71f1469
Compare
Conflicts outside a terminal could only be kept, so scripts and agents running syncode had no way to settle them, and tests could never reach the replace and update paths, the riskiest file changes syncode makes. apply and pull now take --on-conflict keep|replace|update; prompts are unchanged when the flag is omitted. New tests cover replace backing up a local file and moving a link to a file elsewhere as a link (they fail with the bug fixed in review), and update copying the local file into the repo. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
donnes
force-pushed
the
conflict-flags
branch
from
October 22, 2026 07:39
454a665 to
a13bc95
Compare
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
Outside a terminal, syncode can only keep a differing local file. Scripts and agents running syncode (over SSH, in CI, from a coding agent) have no way to settle conflicts. The same limit meant tests could never reach the replace and update paths, which are the riskiest file changes syncode makes. The review bug where "Replace" moved a symlink's target out of a dotfiles repo was only verified by hand in a pseudo-terminal.
Solution
applyandpulltake--on-conflict keep|replace|update. With the flag, every conflict is settled that way without a prompt. Without it, behavior is unchanged: prompt in a terminal, keep otherwise.updateon composed instructions falls back to keep, because those must be edited ininstructions/. The prompt and the flag share one code path, so the tests cover what the prompt does.This adds a user-facing option, so it's stacked last (on #10) and can be dropped on its own.
Verification
replacebacks up a local file and moves a stow-style link to a file elsewhere as a link, leaving that file in place.updatecopies the local file into the repo. An invalid value exits 1.move(current, …)), the replace test fails.bun run checkpasses (12 tests).🤖 Generated with Claude Code