Repository navigation
fix(sdk): report both-added and both-deleted Git conflicts - #2153
Closed
Elon-Jiang wants to merge 1 commit into
Closed
Elon-Jiang wants to merge 1 commit into
Elon-Jiang wants to merge 1 commit into
Conversation
🦋 Changeset detectedLatest commit: 24ce758 The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Member
|
Hey, the Git integration has been deprecated for a while now: |
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 and fix
Both SDKs recognize a Git path as conflicted only when its porcelain status contains
U. Git also usesAA(both added) andDD(both deleted) for unresolved merges. Those paths currently appear as ordinary additions/deletions, andhasConflicts/has_conflictsand the conflict count omit them.Recognize the two additional unmerged pairs in the JS parser and the shared Python parser (used by both sync and async APIs). Ordinary changes retain their classifications. Includes a patch changeset for both SDKs.
The Git status contract lists all seven unmerged pairs. This fixes existing behavior in the currently exported, deprecated Git helper; it adds no new API.
Usage example
After a merge with one add/add conflict:
Verification
Sandbox.git.status()regression matrix: 2 failing / 10 controls passing before, 12 passing after. Runs the real Connect JSON encoding/decoding, Commands, command handles and Git status parsing with an envd transport response fixture.Sandbox.git.status()/AsyncSandbox.git.status(): 4 failing / 20 controls passing before, 24 passing after.AAcomes from real add/add merges andDDfrom real rename/rename merges in temporary repositories. The other unmerged codes are rendered by real Git from native index stages. The real RPC clients/codecs and command handling consume this output through a supplied transport. Native Git fixtures are Unix-only.pnpm run format,pnpm run lint,pnpm run typecheckpass, including SDK builds. Four pre-existing lint warnings remain in unchanged files. Final Python Ruff and ty checks pass after strengthening the real-merge fixtures.git diff --checkpasses.No live E2B sandbox or guest process was used: local Git produces the status output, while envd/network execution is replaced at the transport boundary. Undici's native network path and live sandbox behavior were not measured. The existing documented status contract already covers conflict flags/counts; no separate guide change is needed.
Prepared with AI assistance.