From 6c1dcb94ba1fafb4dd20172551a0078c0f9194dd Mon Sep 17 00:00:00 2001 From: xfocus3 <7467779+xfocus3@users.noreply.github.com> Date: Sat, 30 May 2026 17:23:11 +0100 Subject: [PATCH] Pass --no-ext-diff to internal git diff in standalone mode When invoked as `delta file1 file2`, delta runs `git diff --no-index` and colorizes the result. That invocation honored the user's `diff.external` git config (e.g. `difft`), so the external differ's output was used instead of delta's, even outside any git repository. Pass `--no-ext-diff` so delta always gets git's own diff output to format. Closes #2046 --- src/subcommands/diff.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/subcommands/diff.rs b/src/subcommands/diff.rs index 3346d9fe6..ddcbedba8 100644 --- a/src/subcommands/diff.rs +++ b/src/subcommands/diff.rs @@ -47,7 +47,10 @@ pub fn build_diff_cmd( { ( SubCmdKind::GitDiff, - vec!["git", "diff", "--no-index", "--color"], + // `--no-ext-diff` ensures the user's `diff.external` git config + // (e.g. `difft`) is not used here: delta needs git's own diff + // output to colorize, not a third-party differ's output. See #2046. + vec!["git", "diff", "--no-index", "--no-ext-diff", "--color"], ) } _ => (