fix(git): disable external diff for patch output#2553
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
ApprovabilityVerdict: Approved Simple bug fix adding You can customize Macroscope's approvability policy. Learn more. |
There was a problem hiding this comment.
Pull request overview
Updates server-side Git diff invocations to ensure patch output remains in standard unified diff format even when users have configured an external diff tool (e.g., via diff.external), addressing issue #927.
Changes:
- Add
--no-ext-difftogit diff --patchcalls used for commit-context patch generation. - Add
--no-ext-diffto range diff patch generation for context reads. - Add
--no-ext-diffto checkpoint diff patch generation.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| apps/server/src/vcs/GitVcsDriverCore.ts | Ensures unified patch output for staged and range diffs by disabling external diff tools. |
| apps/server/src/checkpointing/Layers/CheckpointStore.ts | Ensures checkpoint diff patch output stays parseable by disabling external diff tools. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
2e015e3 to
0c857f8
Compare
Dismissing prior approval to re-evaluate 0c857f8
What Changed
Appended
--no-ext-difftogit diff --patchcallsWhy
Having an external diff tool set in git breaks the diff display.
Closes #927
UI Changes
Checklist
Note
Low Risk
Low risk: only tweaks
git diffinvocation flags for patch output, with no changes to business logic or data handling.Overview
Ensures patch output is generated using Git’s built-in diff by appending
--no-ext-diffto thegit diff --patchcalls used for commit preparation (prepareCommitContext) and range context (readRangeContext), preventing external diff tools from breaking diff display.Reviewed by Cursor Bugbot for commit 0c857f8. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Disable external diff tools in
git diffcalls for patch generationAdds
--no-ext-diffto thegit diffinvocations inprepareCommitContextandreadRangeContextin GitVcsDriverCore.ts. This ensures staged and range diff patches always use git's built-in diff output, ignoring any external diff tool configured in the user's git config.Macroscope summarized 0c857f8.