-
-
Notifications
You must be signed in to change notification settings - Fork 232
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Description
After using Gitsigns show ...
to open specific snapshot of a file, Gitsigns blame_line
doesn't work correctly on that snapshot. It often just pops up Not Committed Yet
window, instead of actually blaming the line.
Neovim version
NVIM v0.10.0
Operating system and version
Arch Linux (x86_64) Kernel: 6.9.2-arch1-1
Expected behavior
Gitsigns blame_line
actually blames lines in older file snapshots.
Actual behavior
For some lines (both changed and unchanged by current snapshot), it just shows Not Committed Yet
window, instead of actual commit.
Minimal config
for name, url in pairs{
gitsigns = 'https://github.com/lewis6991/gitsigns.nvim'
} do
local install_path = vim.fn.fnamemodify('gitsigns_issue/'..name, ':p')
if vim.fn.isdirectory(install_path) == 0 then
vim.fn.system { 'git', 'clone', '--depth=1', url, install_path }
end
vim.opt.runtimepath:append(install_path)
end
require('gitsigns').setup{
debug_mode = true
}
Steps to reproduce
- Create testing environment
mkdir gitsigns_test
cd gitsigns_test
git init
echo -e "aaa\nbbb\nccc" > file
git add file
git commit -m "add 3 lines"
echo -e "aaaa\nbbbb\nccc" > file
git commit -am "modify first two lines"
echo -e "aaaa\nbbbbb\ncccc" > file
git commit -am "modify last two lines"
- Open test file with minimal Neovim config
nvim --clean -u minimal.lua file
- Show file snapshot of parent commit (
modify first two lines
)
:Gitsigns show HEAD^
- Observe correctly drawn "signs" on first two lines, indicating that this commit really changed the first two lines.
- Blame the first line (
aaaa
) in order to see who introduced it.
:Gitsigns blame_line
- Observe correct popup window claiming that commit
modify first two lines
introduced it. - Navigate to second line (
bbbb
) which was introduced by the samemodify first two lines
commit. - Blame the second line (
bbbb
) in order to see who introduced it.
:Gitsigns blame_line
- Observe incorrect
Not Committed Yet
popup, instead ofmodify first two lines
. - Navigate to third line (
ccc
) which wasn't modified by this commit. - Blame the third line in order to see who introduced it.
:Gitsigns blame_line
- Observe incorrect
Not Committed Yet
popup, instead of initial commitadd 3 lines
.
Gitsigns debug messages
No response
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working