-
-
Notifications
You must be signed in to change notification settings - Fork 237
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Description
When using vimdiff I wanted to display the revision of the current buffer on the statusline, however gitsigns_head
only shows nil
when no inside a branch. It would be nice to instead display a (shortened) commit hash.
Neovim version
NVIM v0.9.5 Build type: Release LuaJIT 2.1.1693350652 system vimrc file: "$VIM/sysinit.vim" fall-back for $VIM: " /nix/store/0mrn8874pisnpizlkkvcchkly3dkrhif-neovim-unwrapped-0.9.5/share/nvim "
Operating system and version
NixOS unstable
Expected behavior
Show (shortened) commit hash when in buffer at revision without pointing branch.
Actual behavior
Shows nil instead
Minimal config
for name, url in pairs{
gitsigns = 'https://github.com/lewis6991/gitsigns.nvim',
-- ADD OTHER PLUGINS _NECESSARY_ TO REPRODUCE THE ISSUE
} 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, -- 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
nvim --clean -u minimal.lua
inside git repo- make a change to a file
:Gitsigns diffthis
:lua print(vim.b.gitsigns_head)
Gitsigns debug messages
No response
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working