bug: Diff review only shows untracked files if git diff.mnemonicPrefix is set to true #175

Closed
opened 2026-09-21 18:12:55 +00:00 by barrettruth · 0 comments
Owner

Original issue: barrettruth/diffs.nvim#410
Original author: micampe
Original date: 2026-06-14T09:05:29Z

Prerequisites

Neovim version

0.12.3

Operating system

macOS 15

Description

Image

Steps to reproduce

  1. set diff.mnemonicPrefix to true in git config
  2. in a repository with some changes and untracked files, run :Diff review
  3. run :copen

Both the diff and the quickfix list only show the untracked files, modified files are missing.

Use this init.lua for easy repro; :Diff1 review sets mnemonicPrefix to show the bug even if it's not set in the global git config.

vim.pack.add({"https://github.com/barrettruth/diffs.nvim"})

vim.api.nvim_create_user_command('Diff1', function (args)
    vim.env.GIT_CONFIG_COUNT = '1'
    vim.env.GIT_CONFIG_KEY_0 = 'diff.mnemonicPrefix'
    vim.env.GIT_CONFIG_VALUE_0 = 'true'
    vim.cmd.Diff(args.fargs)
end, {nargs = '*'})

Health check

diffs.nvim ~
- ✅ OK Neovim 0.9.0+ detected
- ⚠️ WARNING vim-fugitive not detected (required for unified diff highlighting)
- libvscode_diff not found (optional, using native vim.diff fallback)
- difftastic not enabled (optional, set integrations.difftastic)

Minimal reproduction

local host_data_site = vim.fn.stdpath('data') .. '/site'
local root = vim.fn.fnamemodify('.repro', ':p')
vim.fn.mkdir(root, 'p')
vim.env.XDG_CONFIG_HOME = root
vim.env.XDG_DATA_HOME = root
vim.env.XDG_STATE_HOME = root
vim.env.XDG_CACHE_HOME = root

local data_site = vim.fn.stdpath('data') .. '/site'
vim.fn.mkdir(data_site, 'p')
vim.opt.packpath:prepend(data_site)
if vim.uv.fs_stat(host_data_site) then
  vim.opt.runtimepath:append(host_data_site)
end

vim.o.background = 'dark'
vim.cmd.colorscheme('habamax')

vim.g.diffs = {
  debug = '/tmp/diffs.log',
  integrations = {
    fugitive = true,
    neogit = true,
    gitsigns = true,
    committia = true,
    telescope = true,
  },
}

local plugins = {
  { name = 'vim-fugitive', src = 'https://github.com/tpope/vim-fugitive' },
  { name = 'plenary.nvim', src = 'https://github.com/nvim-lua/plenary.nvim' },
  { name = 'neogit', src = 'https://github.com/NeogitOrg/neogit' },
  { name = 'gitsigns.nvim', src = 'https://github.com/lewis6991/gitsigns.nvim' },
  { name = 'committia.vim', src = 'https://github.com/rhysd/committia.vim' },
  { name = 'telescope.nvim', src = 'https://github.com/nvim-telescope/telescope.nvim' },
  { name = 'diffs.nvim', src = 'https://github.com/barrettruth/diffs.nvim' },
}

local uv = vim.uv or vim.loop

local function clone(src, path)
  if uv.fs_stat(path) then
    return
  end
  vim.fn.mkdir(vim.fn.fnamemodify(path, ':h'), 'p')
  local out = vim.fn.system({ 'git', 'clone', '--filter=blob:none', src, path })
  if vim.v.shell_error ~= 0 then
    error(out)
  end
end

if vim.pack then
  vim.pack.add(vim.tbl_map(function(plugin)
    return { src = plugin.src, name = plugin.name }
  end, plugins), { confirm = false })
else
  for _, plugin in ipairs(plugins) do
    local path = data_site .. '/pack/repro/start/' .. plugin.name
    clone(plugin.src, path)
    vim.opt.runtimepath:prepend(path)
  end
end

require('gitsigns').setup()
require('neogit').setup({})
> Original issue: barrettruth/diffs.nvim#410 > Original author: `micampe` > Original date: 2026-06-14T09:05:29Z ### Prerequisites - [x] I have searched [existing issues](https://github.com/barrettruth/diffs.nvim/issues) - [x] I have updated to the latest version ### Neovim version ```text 0.12.3 ``` ### Operating system macOS 15 ### Description <img width="971" height="838" alt="Image" src="https://forge.barrettruth.com/attachments/c6cb54f1-97d4-424a-8ec1-cc1ba0bedd2d" /> ### Steps to reproduce 1. set `diff.mnemonicPrefix` to true in git config 2. in a repository with some changes and untracked files, run `:Diff review` 3. run `:copen` Both the diff and the quickfix list only show the untracked files, modified files are missing. Use this `init.lua` for easy repro; `:Diff1 review` sets `mnemonicPrefix` to show the bug even if it's not set in the global git config. ```lua vim.pack.add({"https://github.com/barrettruth/diffs.nvim"}) vim.api.nvim_create_user_command('Diff1', function (args) vim.env.GIT_CONFIG_COUNT = '1' vim.env.GIT_CONFIG_KEY_0 = 'diff.mnemonicPrefix' vim.env.GIT_CONFIG_VALUE_0 = 'true' vim.cmd.Diff(args.fargs) end, {nargs = '*'}) ``` ### Health check ```text diffs.nvim ~ - ✅ OK Neovim 0.9.0+ detected - ⚠️ WARNING vim-fugitive not detected (required for unified diff highlighting) - libvscode_diff not found (optional, using native vim.diff fallback) - difftastic not enabled (optional, set integrations.difftastic) ``` ### Minimal reproduction ```lua local host_data_site = vim.fn.stdpath('data') .. '/site' local root = vim.fn.fnamemodify('.repro', ':p') vim.fn.mkdir(root, 'p') vim.env.XDG_CONFIG_HOME = root vim.env.XDG_DATA_HOME = root vim.env.XDG_STATE_HOME = root vim.env.XDG_CACHE_HOME = root local data_site = vim.fn.stdpath('data') .. '/site' vim.fn.mkdir(data_site, 'p') vim.opt.packpath:prepend(data_site) if vim.uv.fs_stat(host_data_site) then vim.opt.runtimepath:append(host_data_site) end vim.o.background = 'dark' vim.cmd.colorscheme('habamax') vim.g.diffs = { debug = '/tmp/diffs.log', integrations = { fugitive = true, neogit = true, gitsigns = true, committia = true, telescope = true, }, } local plugins = { { name = 'vim-fugitive', src = 'https://github.com/tpope/vim-fugitive' }, { name = 'plenary.nvim', src = 'https://github.com/nvim-lua/plenary.nvim' }, { name = 'neogit', src = 'https://github.com/NeogitOrg/neogit' }, { name = 'gitsigns.nvim', src = 'https://github.com/lewis6991/gitsigns.nvim' }, { name = 'committia.vim', src = 'https://github.com/rhysd/committia.vim' }, { name = 'telescope.nvim', src = 'https://github.com/nvim-telescope/telescope.nvim' }, { name = 'diffs.nvim', src = 'https://github.com/barrettruth/diffs.nvim' }, } local uv = vim.uv or vim.loop local function clone(src, path) if uv.fs_stat(path) then return end vim.fn.mkdir(vim.fn.fnamemodify(path, ':h'), 'p') local out = vim.fn.system({ 'git', 'clone', '--filter=blob:none', src, path }) if vim.v.shell_error ~= 0 then error(out) end end if vim.pack then vim.pack.add(vim.tbl_map(function(plugin) return { src = plugin.src, name = plugin.name } end, plugins), { confirm = false }) else for _, plugin in ipairs(plugins) do local path = data_site .. '/pack/repro/start/' .. plugin.name clone(plugin.src, path) vim.opt.runtimepath:prepend(path) end end require('gitsigns').setup() require('neogit').setup({}) ```
barrettruth 2026-09-21 18:12:55 +00:00
  • closed this issue
  • added the
    bug
    label
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
barrettruth/diffs.nvim#175
No description provided.