fix(git): disable external diff for patch output#2553
fix(git): disable external diff for patch output#2553stromseng wants to merge 2 commits 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 diffflags for patch-generating commands, with no changes to repo state or auth/data handling. Main impact is patch output formatting/compatibility with user-configured external diff drivers.Overview
Ensures patch output is generated with Git’s built-in diff by adding
--no-ext-difftogit diff --patchinvocations.This affects checkpoint-to-checkpoint diffs (
CheckpointStore.diffCheckpoints), staged patch generation inprepareCommitContext, and range diff patch generation inreadRangeContext, preventing external diff tools from breaking server-side diff display.Reviewed by Cursor Bugbot for commit 2e015e3. 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 2e015e3.