-
-
Notifications
You must be signed in to change notification settings - Fork 148
Description
Description
Untracked files are not displayed when using DiffviewOpen to compare the working tree against a specific commit (e.g., DiffviewOpen HEAD~2), even though the documentation indicates this should show all working tree changes.
Note
I noticed the code has an explicit check to only show untracked files for STAGE..LOCAL comparisons, so this might be intentional behavior. However, it seems inconsistent with the documentation which states "Diff the working tree against a specific commit". If this is by design, I apologize for the confusion, but I wanted to raise this as the current behavior was unexpected.
Expected behavior
When running :DiffviewOpen HEAD~2, untracked files should be visible in the file panel since we're comparing the working tree (which includes untracked files) against a specific commit.
Actual behavior
Untracked files are not displayed when using DiffviewOpen with any commit reference. They only appear when running DiffviewOpen without arguments (comparing index vs working tree).
Steps to reproduce
- Create an untracked file:
echo "test" > untracked.txt - Run
:DiffviewOpen HEAD~1(or any commit reference) - Observe that
untracked.txtis not shown in the file panel - Run
:DiffviewOpenwithout arguments - Observe that
untracked.txtis now visible
Health check
==============================================================================
diffview: 1
Checking plugin dependencies ~
- ✅ OK nvim-web-devicons installed.
Checking VCS tools ~
- The plugin requires at least one of the supported VCS tools to be valid.
- ✅ OK Git found.
- ✅ OK Git is up-to-date. (2.50.0)
⚠️ WARNING Configuredhg_cmdis not executable: 'hg'
Log info
No response
Neovim version
NVIM v0.11.2
Build type: Release
LuaJIT 2.1.1748459687Operating system and version
macOS v15.5
Minimal config
return {
"sindrets/diffview.nvim",
lazy = false,
keys = {},
config = function()
require("diffview").setup({})
end
}