Skip to content

Pass --no-ext-diff to git so GIT_EXTERNAL_DIFF doesn't break parsing#21

Open
icholy wants to merge 1 commit into
nilbuild:mainfrom
icholy:fix-no-ext-diff
Open

Pass --no-ext-diff to git so GIT_EXTERNAL_DIFF doesn't break parsing#21
icholy wants to merge 1 commit into
nilbuild:mainfrom
icholy:fix-no-ext-diff

Conversation

@icholy

@icholy icholy commented May 7, 2026

Copy link
Copy Markdown

When GIT_EXTERNAL_DIFF is set (e.g. difftastic), git diff emits the external tool's output instead of unified diff format. The parser sees no recognizable hunks and the UI shows 'No changes found'. Disable the external diff driver for all internal diff calls.

@cschanhniem

Copy link
Copy Markdown

The fix needs --no-ext-diff added to every git diff invocation in packages/git/src/diff.ts. Four call sites need updating:

  1. getDiff() (line ~2): Change git diff to git diff --no-ext-diff in the cmd construction
  2. getDiffStat() (line ~67): Add --no-ext-diff after git diff and before --stat
  3. getDiffFiles() (line ~52): Add --no-ext-diff to the git diff --name-only command
  4. getUntrackedDiff() (line ~16): Add --no-ext-diff to the git diff --no-index command

The simplest approach is to add --no-ext-diff directly in the getDiff() and getDiffStat() functions since they are the central diff entry points. The getUntrackedDiff and getDiffFiles functions call git diff directly so they need separate changes.

Would you like me to open a PR with these changes?

@icholy

icholy commented Jun 19, 2026

Copy link
Copy Markdown
Author

... this is a PR with those changes

@cschanhniem

Copy link
Copy Markdown

Right you are — the PR is already up. Thanks for pointing out the redundancy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants