Repository navigation
feat: report drift in status and add dryRun to pull and push - #106
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 #100
What
statusgets two new lines:Local changes:how many synced files differ from what the repo holds (ornone).Remote:up to date,N commit(s) not yet pulled,N local commit(s) not yet pushed, orunreachable.pullandpushacceptdryRun: true. They list what would change and change nothing.pullandpushruns now end with a per-file summary, for example2 files: 1 updated, 1 addedfollowed byupdate config/opencode.jsonlines (capped at 15).How
inspectRemoteDrift():git fetch --prune,rev-list --left-right --count, andgit diff --name-status HEAD origin/<branch>. It never moves the branch or the working tree, unlikefetchAndFastForward.config/andstate/only) with the existingsyncLocalToRepo, then read that clone'sgit status. This reuses the exact push logic (secret scrubbing, overrides, extra paths), does not touch the real sync repo or config, and does not write the overrides file. The scratch directory is always removed.Limits
Local changesisunknownwhen the plugin's clone has pending changes, because the comparison would not be meaningful.config/...), not local paths.statusnow does a network fetch. It fails soft withRemote: unreachable.Tests
preview.test.ts: summary formatting (counts, porcelain and name-status input, renames, truncation).service.test.ts: two machines against a local bare remote. Edit locally,statusshows the drift whileWorking treestaysclean;pushdry run lists the file and leaves the remote and local files untouched; a real push summarises; the other machine'sstatusshows the remote ahead;pulldry run lists the change without applying it; a real pull summarises; a final dry run reports up to date.bun run check,bun run test(211 passing) andbun run buildpass.