Skip to content

Recent worktree regression #1020

@kris-swann

Description

@kris-swann

Description

After a recent upgrade, I noticed that gitsigns stopped showing up for my dotfiles (I use a bare gitdir as a worktree for this)

Also, just want to say a quick thanks for all the hard work on this plugin, really appreciate it!

Neovim version

NVIM v0.9.5 Build type: Release LuaJIT 2.1.1692716794

Operating system and version

Ubuntu 22.04.4

Expected behavior

detached worktrees gitsigns are displayed

Actual behavior

detached worktree gitsigns are not displayed

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
    -- NOTE: had to remove depth=1
    vim.fn.system({ 'git', 'clone', 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
  worktrees = {
    {
      -- Gitsigns in dotfiles!
      toplevel = vim.env.HOME,
      gitdir = vim.env.HOME .. '/Projects/dotfiles', -- NOTE: This is a bare .git directory
    },
  },
})

Steps to reproduce

  1. cd gitsigns_issue/gitsigns
  2. git checkout d6a3bf0b36b7e0f09e39f738f9f87ab1e3c450dc
  3. nvim --clean -u minimal.lua my_file_that_has_changes
  4. Gitsigns show up, as expected
  5. git checkout a28bb1db506df663b063cc63f44fbbda178255a7
  6. nvim --clean -u minimal.lua my_file_that_has_changes
  7. Gitsigns do not show up

Gitsigns debug messages

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions