From 5324f6a8c9a9b0985936a17cbe1d1b0bbe3ef535 Mon Sep 17 00:00:00 2001 From: Mateus Bento Date: Wed, 29 Jul 2026 13:09:22 -0300 Subject: [PATCH] fix(git): disable external diff for review diff previews 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 #927. #927 was closed by #2553, which added --no-ext-diff to prepareCommitContext and readRangeContext, and #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. --- apps/server/src/vcs/GitVcsDriverCore.ts | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/apps/server/src/vcs/GitVcsDriverCore.ts b/apps/server/src/vcs/GitVcsDriverCore.ts index f739c98da29..f6c163a557a 100644 --- a/apps/server/src/vcs/GitVcsDriverCore.ts +++ b/apps/server/src/vcs/GitVcsDriverCore.ts @@ -2001,7 +2001,18 @@ export const makeGitVcsDriverCore = Effect.fn("makeGitVcsDriverCore")(function* executeGit( "GitVcsDriver.readUntrackedReviewDiffs.diff", cwd, - ["diff", "--no-index", "--patch", "--minimal", "--", "/dev/null", relativePath], + [ + "diff", + "--no-index", + "--patch", + "--no-color", + "--no-ext-diff", + "--no-textconv", + "--minimal", + "--", + "/dev/null", + relativePath, + ], { allowNonZeroExit: true, maxOutputBytes: REVIEW_UNTRACKED_DIFF_MAX_OUTPUT_BYTES, @@ -2046,6 +2057,9 @@ export const makeGitVcsDriverCore = Effect.fn("makeGitVcsDriverCore")(function* [ "diff", "--patch", + "--no-color", + "--no-ext-diff", + "--no-textconv", "--minimal", ...(input.ignoreWhitespace ? ["--ignore-all-space"] : []), "HEAD", @@ -2079,6 +2093,9 @@ export const makeGitVcsDriverCore = Effect.fn("makeGitVcsDriverCore")(function* [ "diff", "--patch", + "--no-color", + "--no-ext-diff", + "--no-textconv", "--minimal", ...(input.ignoreWhitespace ? ["--ignore-all-space"] : []), `${baseRef}...HEAD`,