Skip to content

fix(git): disable external diff for review diff previews - #4854

Merged
juliusmarminge merged 1 commit into
pingdotgg:mainfrom
ohbentos:fix/no-ext-diff-review-diff-preview
Jul 29, 2026
Merged

fix(git): disable external diff for review diff previews#4854
juliusmarminge merged 1 commit into
pingdotgg:mainfrom
ohbentos:fix/no-ext-diff-review-diff-preview

Conversation

@ohbentos

@ohbentos ohbentos commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

What Changed

Added --no-color --no-ext-diff --no-textconv to the three git diff invocations in
getReviewDiffPreview (apps/server/src/vcs/GitVcsDriverCore.ts):

  • getReviewDiffPreview.dirtyTracked — the Diff panel's Working tree scope
  • getReviewDiffPreview.base — the Diff panel's Branch scope (base...HEAD)
  • readUntrackedReviewDiffs.diff — untracked files, via --no-index

Flags are inline at each call site, matching the checkpoint diff in GitVcsDriver.ts and the
guidance from #1092 (no shared helper).

Why

When a user has diff.external configured, git diff delegates to that tool and stops emitting a
unified patch, so parsePatchFiles can't read it and the panel falls back to
"Unsupported diff format. Showing raw patch." That's #927.

#927 has already been fixed twice, each time for a different set of call sites, and the review
diff preview was in neither.
The flag reached the codebase piecemeal:

Call site Fixed by
checkpoints.diffCheckpoints 5165b8c (#2586) — incidentally, in a perf PR
prepareCommitContext.stagedPatch 7db0349 (#2553) — the fix that closed #927
readRangeContext.diffPatch 7db0349 (#2553)
getReviewDiffPreview.dirtyTracked still broken
getReviewDiffPreview.base still broken
readUntrackedReviewDiffs.diff still broken

The three remaining ones aren't new code — they landed in b3e8c03 (#2013) on May 29, two weeks
before #2553 — they just weren't in that PR's scope. #2352 and #1092 proposed fixes too, and their
call-site lists didn't include them either. So #927 is closed, and the two scopes users actually
look at in the Diff panel still route through the external tool.

Repro, with any external diff driver (git config --global diff.external difft): open the Diff
panel, switch to Working tree or Branch, and it renders raw tool output instead of a diff. Same
patch fed to parsePatchFiles parses to 0 files with the external driver and 1 file with
--no-ext-diff.

Validation

  • vp test run apps/server/src/vcs/GitVcsDriverCore.test.ts — 38 passed
  • tsgo --noEmit in apps/server — clean
  • Manual repro above, in a scratch repo with diff.external set

No new regression test here, matching #2553.

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
Narrow change to git CLI flags on review preview paths; behavior only shifts when users have external diff or textconv configured, and aligns with existing fixed call sites.

Overview
Adds --no-color, --no-ext-diff, and --no-textconv to the three git diff paths that feed the Diff panel review preview in GitVcsDriverCore.ts, matching flags already used on checkpoint, commit, and range diff calls.

Working tree (getReviewDiffPreview.dirtyTracked), branch range (getReviewDiffPreview.base), and untracked (readUntrackedReviewDiffs via --no-index) now always emit a unified patch Git can parse instead of delegating to diff.external, which had left the panel on “Unsupported diff format” for those scopes.

Reviewed by Cursor Bugbot for commit 5324f6a. Bugbot is set up for automated code reviews on this repo. Configure here.

Note

Disable external diff, textconv, and color in GitVcsDriver review diff previews

Adds --no-ext-diff, --no-textconv, and --no-color flags to all three git diff invocations in GitVcsDriverCore.ts — untracked files, dirty tracked changes, and base comparisons. This ensures raw git output is used instead of any user-configured external diff or textconv drivers.

Behavioral Change: repositories with external diff tools or textconv filters configured will now see different patch output in review diff previews.

Macroscope summarized 5324f6a.

With diff.external configured, git diff delegates to that tool instead of
emitting a unified patch, so the Diff panel cannot parse it and falls back to
"Unsupported diff format. Showing raw patch." That is pingdotgg#927.

pingdotgg#927 was closed by pingdotgg#2553, which added --no-ext-diff to prepareCommitContext
and readRangeContext, and pingdotgg#2586 had already added it to the checkpoint diff.
Neither covered getReviewDiffPreview, which backs the Working tree and Branch
scopes, so those two still route through the external tool.

Adds --no-color --no-ext-diff --no-textconv to the three remaining call sites:
the tracked working-tree diff, the base...HEAD branch diff, and the --no-index
untracked file diffs.
@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:S 10-29 changed lines (additions + deletions). labels Jul 29, 2026
@coderabbitai

coderabbitai Bot commented Jul 29, 2026

Copy link
Copy Markdown

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 Plus

Run ID: 10594932-b6bc-49d1-85df-bf81b3dce668

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

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.

@macroscopeapp

macroscopeapp Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved 5324f6a

Adds standard git flags (--no-color, --no-ext-diff, --no-textconv) to diff commands to ensure consistent output regardless of user's local git configuration. This is a defensive fix with clear intent and no behavioral changes beyond making diff generation more robust.

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

@juliusmarminge
juliusmarminge enabled auto-merge (squash) July 29, 2026 16:23
@juliusmarminge
juliusmarminge merged commit 85a8986 into pingdotgg:main Jul 29, 2026
17 checks passed
ohbentos added a commit to ohbentos/t3code that referenced this pull request Jul 29, 2026
github-actions Bot added a commit to omarcresp/t3code-flake that referenced this pull request Jul 29, 2026
## What's Changed
* fix(server): detect repositories after initialization by @StiensWout in pingdotgg/t3code#4848
* perf(server): merge separate staged/unstaged numstat calls into single diff HEAD --numstat by @UtkarshUsername in pingdotgg/t3code#4843
* fix(git): disable external diff for review diff previews by @ohbentos in pingdotgg/t3code#4854
* Fix editable file focus and live syntax highlighting by @jakeleventhal in pingdotgg/t3code#3979
* fix(web): remember the rendered-markdown choice across threads by @Sy-D in pingdotgg/t3code#4853

## New Contributors
* @ohbentos made their first contribution in pingdotgg/t3code#4854
* @Sy-D made their first contribution in pingdotgg/t3code#4853

**Full Changelog**: pingdotgg/t3code@v0.0.31-nightly.20260729.946...v0.0.31-nightly.20260729.948

Upstream release: https://github.com/pingdotgg/t3code/releases/tag/v0.0.31-nightly.20260729.948
github-actions Bot added a commit to omarcresp/t3code-flake that referenced this pull request Jul 29, 2026
## What's Changed
* Fix Connect sign-in settings label by @juliusmarminge in pingdotgg/t3code#4806
* fix(desktop): restore T3 Connect sign-in by @PixPMusic in pingdotgg/t3code#4809
* Simplify files panel header by @juliusmarminge in pingdotgg/t3code#4828
* build(desktop): reduce installed app size by ~300MB by @wukko in pingdotgg/t3code#4824
* Update model version from claude-opus-4-8 to claude-opus-5 by @juliusmarminge in pingdotgg/t3code#4832
* Preserve the thread shell while detail loads by @juliusmarminge in pingdotgg/t3code#4830
* Reduce idle work and disk churn with native resource diagnostics by @juliusmarminge in pingdotgg/t3code#2679
* fix(server): detect repositories after initialization by @StiensWout in pingdotgg/t3code#4848
* perf(server): merge separate staged/unstaged numstat calls into single diff HEAD --numstat by @UtkarshUsername in pingdotgg/t3code#4843
* fix(git): disable external diff for review diff previews by @ohbentos in pingdotgg/t3code#4854
* Fix editable file focus and live syntax highlighting by @jakeleventhal in pingdotgg/t3code#3979
* fix(web): remember the rendered-markdown choice across threads by @Sy-D in pingdotgg/t3code#4853

## New Contributors
* @wukko made their first contribution in pingdotgg/t3code#4824
* @ohbentos made their first contribution in pingdotgg/t3code#4854
* @Sy-D made their first contribution in pingdotgg/t3code#4853

**Full Changelog**: pingdotgg/t3code@v0.0.30...v0.0.31

## What's Changed
* Fix Connect sign-in settings label by @juliusmarminge in pingdotgg/t3code#4806
* fix(desktop): restore T3 Connect sign-in by @PixPMusic in pingdotgg/t3code#4809
* Simplify files panel header by @juliusmarminge in pingdotgg/t3code#4828
* build(desktop): reduce installed app size by ~300MB by @wukko in pingdotgg/t3code#4824
* Update model version from claude-opus-4-8 to claude-opus-5 by @juliusmarminge in pingdotgg/t3code#4832
* Preserve the thread shell while detail loads by @juliusmarminge in pingdotgg/t3code#4830
* Reduce idle work and disk churn with native resource diagnostics by @juliusmarminge in pingdotgg/t3code#2679
* fix(server): detect repositories after initialization by @StiensWout in pingdotgg/t3code#4848
* perf(server): merge separate staged/unstaged numstat calls into single diff HEAD --numstat by @UtkarshUsername in pingdotgg/t3code#4843
* fix(git): disable external diff for review diff previews by @ohbentos in pingdotgg/t3code#4854
* Fix editable file focus and live syntax highlighting by @jakeleventhal in pingdotgg/t3code#3979
* fix(web): remember the rendered-markdown choice across threads by @Sy-D in pingdotgg/t3code#4853

## New Contributors
* @wukko made their first contribution in pingdotgg/t3code#4824
* @ohbentos made their first contribution in pingdotgg/t3code#4854
* @Sy-D made their first contribution in pingdotgg/t3code#4853

**Full Changelog**: pingdotgg/t3code@v0.0.30...v0.0.31

Upstream release: https://github.com/pingdotgg/t3code/releases/tag/v0.0.31
tarik02 added a commit to tarik02-org/t3code that referenced this pull request Jul 30, 2026
* fix(desktop): restore T3 Connect sign-in (pingdotgg#4809)

Co-authored-by: Julius Marminge <julius0216@outlook.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>

* Simplify files panel header (pingdotgg#4828)

* build(desktop): reduce installed app size by ~300MB (pingdotgg#4824)

* Update model version from claude-opus-4-8 to claude-opus-5 (pingdotgg#4832)

* Preserve the thread shell while detail loads (pingdotgg#4830)

* Reduce idle work and disk churn with native resource diagnostics (pingdotgg#2679)

Co-authored-by: codex <codex@users.noreply.github.com>

* fix(server): detect repositories after initialization (pingdotgg#4848)

* perf(server): merge separate staged/unstaged numstat calls into single diff HEAD --numstat (pingdotgg#4843)

* fix(git): disable external diff for review diff previews (pingdotgg#4854)

* Fix editable file focus and live syntax highlighting (pingdotgg#3979)

* fix(web): remember the rendered-markdown choice across threads (pingdotgg#4853)

Co-authored-by: Simon Doba <simon.doba@orbit.de>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>

* chore(release): prepare v0.0.31

* fix(mobile): reduce thread feed scroll jank (pingdotgg#4874)

* fix(web): restore sidebar v2 thread actions and terminal icon (pingdotgg#4712)

* fix(web): settle button now works on hover, not just right-click (pingdotgg#4905)

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>

* fix(clients): disable add project while disconnected (pingdotgg#4834)

* fix(composer): hide default Codex service tier (pingdotgg#4784)

* docs: link iOS and Android app store downloads (pingdotgg#4902)

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>

* fix(web): align remote server update action (pingdotgg#4731)

* fix(connect): suggest a serve command that matches how you ran connect (pingdotgg#4897)

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>

* fix(mobile): stop shared content errors in Personal Team builds (pingdotgg#4943)

* perf(mobile): sends respond instantly, thread opens stop freezing (pingdotgg#4882)

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>

* fix(web): show Codex fast mode as a bolt (pingdotgg#4947)

* docs: seed worktrees with a copy of real userdata instead of banning it (pingdotgg#4949)

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>

* fix(mobile): support dragged images in the composer (pingdotgg#4953)

* fix(mobile): stop long iOS threads from jumping while scrolling up (pingdotgg#4867)

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>

* fix(web): keep worktree default when switching a draft's machine (pingdotgg#4964)

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>

* perf(mobile): reconnect environments immediately on resume (pingdotgg#4878)

* feat(web): pasting a huge screenshot now compresses it instead of erroring (pingdotgg#4967)

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>

* feat(web): regenerate thread titles from sidebar (pingdotgg#4810)

* fix(web): show server update progress through reconnect (pingdotgg#4903)

---------

Co-authored-by: Alex <me@pixp.cc>
Co-authored-by: Julius Marminge <julius0216@outlook.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Co-authored-by: wukko <me@wukko.me>
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: Wout Stiens <71498452+StiensWout@users.noreply.github.com>
Co-authored-by: Utkarsh Patil <73941998+UtkarshUsername@users.noreply.github.com>
Co-authored-by: ohbentos <72638975+ohbentos@users.noreply.github.com>
Co-authored-by: Jake Leventhal <jakeleventhal@me.com>
Co-authored-by: Simon Doba <simon.doba@hotmail.de>
Co-authored-by: Simon Doba <simon.doba@orbit.de>
Co-authored-by: t3-code[bot] <269035359+t3-code[bot]@users.noreply.github.com>
Co-authored-by: Gabriel De Andrade <30420087+gabrielelpidio@users.noreply.github.com>
Co-authored-by: Jono Kemball <Noojuno@users.noreply.github.com>
Co-authored-by: Theo Browne <me@t3.gg>
Co-authored-by: Max Katz <me@maxkatz.me>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S 10-29 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