Skip to content

fix(git): disable external diff for patch output#2553

Open
stromseng wants to merge 1 commit intopingdotgg:mainfrom
stromseng:fix/no-ext-diff-patch-output
Open

fix(git): disable external diff for patch output#2553
stromseng wants to merge 1 commit intopingdotgg:mainfrom
stromseng:fix/no-ext-diff-patch-output

Conversation

@stromseng
Copy link
Copy Markdown

@stromseng stromseng commented May 6, 2026

What Changed

Appended --no-ext-diff to git diff --patch calls

Why

Having an external diff tool set in git breaks the diff display.
Closes #927

UI Changes

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for any UI changes
  • I included a video for animation/interaction changes

Note

Low Risk
Low risk: only adjusts git diff invocation 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 --patch outputs, this PR adds --no-ext-diff so configured external diff tools cannot override/garble patch text.

This affects checkpoint diff generation in CheckpointStore and patch collection in GitVcsDriverCore (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-diff to all git diff invocations 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 in prepareCommitContext, the range diff patch in readRangeContext, and checkpoint-to-checkpoint diffs in diffCheckpoints.

Macroscope summarized 6206eea.

Copilot AI review requested due to automatic review settings May 6, 2026 10:50
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 6, 2026

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 1123399a-5921-4a16-8003-0ef6e8185568

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions Bot added size:XS 0-9 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list. labels May 6, 2026
@macroscopeapp
Copy link
Copy Markdown
Contributor

macroscopeapp Bot commented May 6, 2026

Approvability

Verdict: Approved

Small defensive fix adding --no-ext-diff to git diff commands, ensuring consistent patch output regardless of user's git configuration. Clear intent, limited scope, and obvious resolution.

You can customize Macroscope's approvability policy. Learn more.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-diff to git diff --patch calls used for commit-context patch generation.
  • Add --no-ext-diff to range diff patch generation for context reads.
  • Add --no-ext-diff to 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.

Comment thread apps/server/src/vcs/GitVcsDriverCore.ts
Comment thread apps/server/src/vcs/GitVcsDriverCore.ts
Comment thread apps/server/src/checkpointing/Layers/CheckpointStore.ts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS 0-9 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

External diff tool breaks diff display

2 participants