Skip to content

Conversation

@esmuellert
Copy link
Owner

Summary

Fixes a bug where untracked files were not shown when running :CodeDiff <revision>.

Problem

  • :CodeDiff (no args) correctly shows untracked files with ?? status
  • :CodeDiff main or :CodeDiff HEAD did not show untracked files

Root Cause

git diff --name-status <revision> only shows tracked file changes. Untracked files are not part of git's index, so they don't appear in diff output.

Solution

After fetching tracked changes, also fetch untracked files with:

git ls-files --others --exclude-standard

And include them as ?? status entries. This is the standard approach used by git GUIs since there's no single git command that includes untracked files in revision diffs.

Testing

  • E2E tests verified untracked files now appear with :CodeDiff HEAD
  • All 180+ existing tests pass

When running :CodeDiff <revision>, untracked files were not shown because
git diff --name-status only shows tracked file changes.

Fix: After getting tracked changes, also fetch untracked files with
git ls-files --others --exclude-standard and include them as '??' status.

This matches the behavior of :CodeDiff (no args) which uses git status.
@esmuellert esmuellert enabled auto-merge January 27, 2026 01:21
@esmuellert esmuellert merged commit b5321a8 into main Jan 27, 2026
13 checks passed
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