fix(git): disable external diff for review diff previews - #4854
Conversation
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.
|
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 Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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 5324f6a Adds standard git flags ( You can customize Macroscope's approvability policy. Learn more. |
## 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
## 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
What Changed
Added
--no-color --no-ext-diff --no-textconvto the threegit diffinvocations ingetReviewDiffPreview(apps/server/src/vcs/GitVcsDriverCore.ts):getReviewDiffPreview.dirtyTracked— the Diff panel's Working tree scopegetReviewDiffPreview.base— the Diff panel's Branch scope (base...HEAD)readUntrackedReviewDiffs.diff— untracked files, via--no-indexFlags are inline at each call site, matching the checkpoint diff in
GitVcsDriver.tsand theguidance from #1092 (no shared helper).
Why
When a user has
diff.externalconfigured,git diffdelegates to that tool and stops emitting aunified patch, so
parsePatchFilescan'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:
checkpoints.diffCheckpointsprepareCommitContext.stagedPatchreadRangeContext.diffPatchgetReviewDiffPreview.dirtyTrackedgetReviewDiffPreview.basereadUntrackedReviewDiffs.diffThe 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 Diffpanel, switch to Working tree or Branch, and it renders raw tool output instead of a diff. Same
patch fed to
parsePatchFilesparses 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 passedtsgo --noEmitinapps/server— cleandiff.externalsetNo new regression test here, matching #2553.
Checklist
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-textconvto the threegit diffpaths that feed the Diff panel review preview inGitVcsDriverCore.ts, matching flags already used on checkpoint, commit, and range diff calls.Working tree (
getReviewDiffPreview.dirtyTracked), branch range (getReviewDiffPreview.base), and untracked (readUntrackedReviewDiffsvia--no-index) now always emit a unified patch Git can parse instead of delegating todiff.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
GitVcsDriverreview diff previewsAdds
--no-ext-diff,--no-textconv, and--no-colorflags to all threegit diffinvocations 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.