Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Column signs not showing when using fugitive's :0Gclog inside git worktree #686

Closed
rosds opened this issue Dec 14, 2022 · 1 comment · Fixed by #689
Closed

Column signs not showing when using fugitive's :0Gclog inside git worktree #686

rosds opened this issue Dec 14, 2022 · 1 comment · Fixed by #689
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@rosds
Copy link
Contributor

rosds commented Dec 14, 2022

Description

Recently noticed this after starting to use git worktrees. Jumping through the quickfix list populated with the file commits by fugitive's :0Gclog command does not show the changed hunks in the column bar. However this works fine with a normal non-bare repository.

Neovim version

0.8.1

Operating system and version

Ubuntu 20.04 LTS

Expected behavior

No response

Actual behavior

Gitsigns does not return any error. However the hunks of the commits are not displayed nor is it possible to jump between them.

Minimal config

vim.o.packpath = '/tmp/nvim/site'

local plugins = {
  gitsigns = 'https://github.com/lewis6991/gitsigns.nvim',
  fugitive = 'https://github.com/tpope/vim-fugitive'
}

for name, url in pairs(plugins) do
  local install_path = '/tmp/nvim/site/pack/test/start/'..name
  if vim.fn.isdirectory(install_path) == 0 then
    vim.fn.system { 'git', 'clone', '--depth=1', url, install_path }
  end
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

repo setup

mkdir foo
cd foo
git init .
echo 'foo' > foo
git add foo
git commit -m 'add foo'
echo 'bar' >> foo
git add foo
git commit -m 'add bar'

# now the bare repo
cd ..
git clone --bare foo foo-bare
cd foo-bare
git worktree add master
cd master
  1. nvim --clean -u minimal.lua foo
  2. open file's log with fugitive's :0Gclog command

result inside bare repo worktree:
shot_2022-12-14

result in the normal foo repo:
shot_2022-12-14

Gitsigns debug messages

debug messages on non-bare repo:

signs.init: Using vimfn signs                                                                                                                                                                                                        
run_job: git --no-pager --literal-pathspecs --version
fn: Deriving GitSignsAdd from DiffAdd
fn: Deriving GitSignsChange from DiffChange
fn: Deriving GitSignsDelete from DiffDelete
fn: Deriving GitSignsAddNr from GitSignsAdd
fn: Deriving GitSignsChangeNr from GitSignsChange
fn: Deriving GitSignsDeleteNr from GitSignsDelete
fn: Deriving GitSignsAddLn from DiffAdd
fn: Deriving GitSignsChangeLn from DiffChange
fn: Deriving GitSignsAddPreview from DiffAdd
fn: Deriving GitSignsDeletePreview from DiffDelete
fn: Deriving GitSignsCurrentLineBlame from NonText
fn: Deriving GitSignsAddInline from TermCursor
fn: Deriving GitSignsDeleteInline from TermCursor
fn: Deriving GitSignsChangeInline from TermCursor
fn: Deriving GitSignsAddLnInline from GitSignsAddInline
fn: Deriving GitSignsChangeLnInline from GitSignsChangeInline
fn: Deriving GitSignsDeleteLnInline from GitSignsDeleteInline
fn: Deriving GitSignsAddLnVirtLn from GitSignsAddLn
fn: Deriving GitSignsChangeVirtLn from GitSignsChangeLn
fn: Deriving GitSignsDeleteVirtLn from DiffDelete
fn: Deriving GitSignsAddLnVirtLnInLine from GitSignsAddLnInline
fn: Deriving GitSignsChangeVirtLnInLine from GitSignsChangeLnInline
fn: Deriving GitSignsDeleteVirtLnInLine from GitSignsDeleteLnInline
attach(1): Attaching (trigger=setup)
run_job: git --no-pager --literal-pathspecs config user.name
run_job: git --no-pager --literal-pathspecs rev-parse --show-toplevel --absolute-git-dir --abbrev-ref HEAD
run_job: git --no-pager --literal-pathspecs --git-dir /home/alfonso.ros/test/foo/.git -c core.quotepath=off ls-files --stage --others --exclude-standard --eol /home/alfonso.ros/test/foo/foo
watch_gitdir(1): Watching git dir
run_job: git --no-pager --literal-pathspecs --git-dir /home/alfonso.ros/test/foo/.git show :0:foo
update(1): updates: 1, jobs: 5
attach(2): Attaching (trigger=BufRead)
attach(2): Non-normal buffer
attach(2): Attaching (trigger=BufRead)
attach(2): Non-normal buffer
attach(3): Attaching (trigger=BufRead)
get_buf_path(3): Fugitive buffer for file '/home/alfonso.ros/test/foo/foo' from path 'fugitive:///home/alfonso.ros/test/foo/.git//064a120877660fa3f9f6d2e3fa61ffd85c48b3ca/foo'
run_job: git --no-pager --literal-pathspecs config user.name
run_job: git --no-pager --literal-pathspecs rev-parse --show-toplevel --absolute-git-dir --abbrev-ref HEAD
run_job: git --no-pager --literal-pathspecs --git-dir /home/alfonso.ros/test/foo/.git -c core.quotepath=off ls-files --stage --others --exclude-standard --eol /home/alfonso.ros/test/foo/foo
watch_gitdir(3): Watching git dir
run_job: git --no-pager --literal-pathspecs --git-dir /home/alfonso.ros/test/foo/.git show 064a120877660fa3f9f6d2e3fa61ffd85c48b3ca^:foo
update(3): updates: 2, jobs: 9
: Running action 'debug_messages' with arguments {}
: Running action 'debug_messages' with arguments {}

debug messages in bare repo:

signs.init: Using vimfn signs                                                                                                                                                                                                       
run_job: git --no-pager --literal-pathspecs --version
fn: Deriving GitSignsAdd from DiffAdd
fn: Deriving GitSignsChange from DiffChange
fn: Deriving GitSignsDelete from DiffDelete
fn: Deriving GitSignsAddNr from GitSignsAdd
fn: Deriving GitSignsChangeNr from GitSignsChange
fn: Deriving GitSignsDeleteNr from GitSignsDelete
fn: Deriving GitSignsAddLn from DiffAdd
fn: Deriving GitSignsChangeLn from DiffChange
fn: Deriving GitSignsAddPreview from DiffAdd
fn: Deriving GitSignsDeletePreview from DiffDelete
fn: Deriving GitSignsCurrentLineBlame from NonText
fn: Deriving GitSignsAddInline from TermCursor
fn: Deriving GitSignsDeleteInline from TermCursor
fn: Deriving GitSignsChangeInline from TermCursor
fn: Deriving GitSignsAddLnInline from GitSignsAddInline
fn: Deriving GitSignsChangeLnInline from GitSignsChangeInline
fn: Deriving GitSignsDeleteLnInline from GitSignsDeleteInline
fn: Deriving GitSignsAddLnVirtLn from GitSignsAddLn
fn: Deriving GitSignsChangeVirtLn from GitSignsChangeLn
fn: Deriving GitSignsDeleteVirtLn from DiffDelete
fn: Deriving GitSignsAddLnVirtLnInLine from GitSignsAddLnInline
fn: Deriving GitSignsChangeVirtLnInLine from GitSignsChangeLnInline
fn: Deriving GitSignsDeleteVirtLnInLine from GitSignsDeleteLnInline
attach(1): Attaching (trigger=setup)
run_job: git --no-pager --literal-pathspecs config user.name
run_job: git --no-pager --literal-pathspecs rev-parse --show-toplevel --absolute-git-dir --abbrev-ref HEAD
run_job: git --no-pager --literal-pathspecs --git-dir /home/alfonso.ros/test/foo-bare/worktrees/master --work-tree /home/alfonso.ros/test/foo-bare/master -c core.quotepath=off ls-files --stage --others --exclude-standard --eol /home/alfon
so.ros/test/foo-bare/master/foo
watch_gitdir(1): Watching git dir
run_job: git --no-pager --literal-pathspecs --git-dir /home/alfonso.ros/test/foo-bare/worktrees/master --work-tree /home/alfonso.ros/test/foo-bare/master show :0:foo
update(1): updates: 1, jobs: 5
attach(2): Attaching (trigger=BufRead)
attach(2): Non-normal buffer
attach(2): Attaching (trigger=BufRead)
attach(2): Non-normal buffer
attach(3): Attaching (trigger=BufRead)
get_buf_path(3): Fugitive buffer for file 'fugitive:///home/alfonso.ros/test/foo-bare/worktrees/master//064a120877660fa3f9f6d2e3fa61ffd85c48b3ca/foo' from path 'fugitive:///home/alfonso.ros/test/foo-bare/worktrees/master//064a120877660fa3
f9f6d2e3fa61ffd85c48b3ca/foo'
attach(3): Not a path
: Running action 'debug_messages' with arguments {}
@rosds rosds added the bug Something isn't working label Dec 14, 2022
@lewis6991
Copy link
Owner

Thanks for providing a full issue report (a lot of people don't).

I haven't got much experience with bare repos and don't use them, and also being spread quite thin over a few projects, so I'm not likely to look at this for a while.

If you want to tackle this yourself (or anyone) then I'm happy to provide help and advice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
2 participants