Skip to content

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

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

fix(git): disable external diff for patch output#2553
stromseng wants to merge 1 commit into
pingdotgg: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 tweaks git diff invocation 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-diff to the git diff --patch calls 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 diff calls for patch generation

Adds --no-ext-diff to the git diff invocations in prepareCommitContext and readRangeContext in 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.

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: 41acee88-21b7-4f43-9f74-272b12af9bbd

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[bot]
macroscopeapp Bot previously approved these changes May 6, 2026
@macroscopeapp
Copy link
Copy Markdown
Contributor

macroscopeapp Bot commented May 6, 2026

Approvability

Verdict: Approved

Simple bug fix adding --no-ext-diff to git diff commands, ensuring consistent patch output regardless of user's external diff configuration. This is a standard defensive fix with no behavioral side effects.

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 Outdated
@stromseng stromseng force-pushed the fix/no-ext-diff-patch-output branch from 2e015e3 to 0c857f8 Compare May 13, 2026 09:00
@macroscopeapp macroscopeapp Bot dismissed their stale review May 13, 2026 09:01

Dismissing prior approval to re-evaluate 0c857f8

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