fix(git): disable external diff for patch output#2553
fix(git): disable external diff for patch output#2553stromseng wants to merge 1 commit intopingdotgg:mainfrom
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 Small defensive 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.
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 adjusts
git diffinvocation flags to ensure consistent patch output, with no changes to data models or control flow beyond diff generation.Overview
For all server-side
git diff --patchoutputs, this PR adds--no-ext-diffso configured external diff tools cannot override/garble patch text.This affects checkpoint diff generation in
CheckpointStoreand patch collection inGitVcsDriverCore(staged patch for commit context and range diff patch).Reviewed by Cursor Bugbot for commit 6206eea. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Disable external diff drivers for patch output in git diff calls
Adds
--no-ext-diffto allgit diffinvocations that generate patch output, ensuring Git's internal diff is used regardless of any external diff drivers configured in the repo. Affected calls are the staged patch inprepareCommitContext, the range diff patch inreadRangeContext, and checkpoint-to-checkpoint diffs indiffCheckpoints.Macroscope summarized 6206eea.