You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When running :Gitsigns change_base <branch_name> I expect Gitsigns to show the difference between the current file and the version that's on the tip of <branch_name>. However, it seems like Gitsigns is adding a ^ to the end of the revision string, thus causing unexpected diffs. Instead of comparing against, for example, master, Gitsigns is comparing against master^
Here's the code and the commit that's adding the ^, everything works as expected if I remove the ^ but I'm not sure if it's there to serve some other purposes.
After doing the reproduce steps, no git change line should be shown.
Actual behavior
A git change indicator was shown
Minimal config
forname, urlinpairs{
gitsigns='https://github.com/lewis6991/gitsigns.nvim',
-- ADD OTHER PLUGINS _NECESSARY_ TO REPRODUCE THE ISSUE
} dolocalinstall_path=vim.fn.fnamemodify('gitsigns_issue/'..name, ':p')
ifvim.fn.isdirectory(install_path) ==0thenvim.fn.system { 'git', 'clone', '--depth=1', url, install_path }
endvim.opt.runtimepath:append(install_path)
endrequire('gitsigns').setup{
debug_mode=true, -- You must add this to enable debug messages-- ADD GITSIGNS CONFIG THAT IS _NECESSARY_ FOR REPRODUCING THE ISSUE
}
-- ADD INIT.LUA SETTINGS THAT IS _NECESSARY_ FOR REPRODUCING THE ISSUE
Steps to reproduce
mkdir gitsigns_issue
cd gitsigns_issue
git init
echo 1 > file
git add file
git commit -m 'commit msg'
git switch -c branch
nvim --clean -u minimal.lua file
:Gitsigns change_base master
Gitsigns debug messages
9659.55 D cli.run: Running action 'change_base' with arguments { "master" }
9659.60 D run_job: git --no-pager --no-optional-locks --literal-pathspecs -c gc.auto=0 --git-dir /home/xxx/gitsigns_issue/.git -c core.quotepath=off ls-tree master /home/xxx/gitsigns_issue/file
9661.29 D run_job: git --no-pager --no-optional-locks --literal-pathspecs -c gc.auto=0 --git-dir /home/xxx/gitsigns_issue/.git show d00491fd7e5bb6fa28c517a0bb32b8b506539d4d
9663.12 D run_job: git --no-pager --no-optional-locks --literal-pathspecs -c gc.auto=0 --git-dir /home/xxx/gitsigns_issue/.git show master^:file
Gitsigns cache
No response
The text was updated successfully, but these errors were encountered:
Description
When running
:Gitsigns change_base <branch_name>
I expect Gitsigns to show the difference between the current file and the version that's on the tip of <branch_name>. However, it seems like Gitsigns is adding a^
to the end of the revision string, thus causing unexpected diffs. Instead of comparing against, for example,master
, Gitsigns is comparing againstmaster^
Here's the code and the commit that's adding the
^
, everything works as expected if I remove the^
but I'm not sure if it's there to serve some other purposes.gitsigns.nvim/lua/gitsigns/manager.lua
Line 479 in 1ef74b5
47c8e3e
Neovim version
NVIM v0.10.1
Operating system and version
openSUSE Tumbleweed 20240901
Expected behavior
After doing the reproduce steps, no git change line should be shown.
Actual behavior
A git change indicator was shown
Minimal config
Steps to reproduce
mkdir gitsigns_issue
cd gitsigns_issue
git init
echo 1 > file
git add file
git commit -m 'commit msg'
git switch -c branch
nvim --clean -u minimal.lua file
:Gitsigns change_base master
Gitsigns debug messages
Gitsigns cache
No response
The text was updated successfully, but these errors were encountered: