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

Recent worktree regression #1020

Closed
kris-swann opened this issue May 24, 2024 · 6 comments · Fixed by #1034 or #1011
Closed

Recent worktree regression #1020

kris-swann opened this issue May 24, 2024 · 6 comments · Fixed by #1034 or #1011
Labels
bug Something isn't working

Comments

@kris-swann
Copy link

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

@kris-swann kris-swann added the bug Something isn't working label May 24, 2024
@lewis6991
Copy link
Owner

What commands are needed to recreate the dotfiles directory?

@kris-swann
Copy link
Author

kris-swann commented May 24, 2024

I use this for mine

  • git clone --separate-git-dir=$HOME/Projects/dotfiles https://github.com/kris-swann/dotfiles $HOME/tmpdotfiles
  • rsync --recursive --verbose --exclude '.git' $HOME/tmpdotfiles/ $HOME/ rm -r $HOME/tmpdotfiles

Probably don't run that exact rsync command since it'll overwrite your existing config files.

Lmk if I should try to create something easier for minimal testing

@orjangj
Copy link

orjangj commented May 25, 2024

Looks like a28bb1d introduced the regression. Worktrees works as expected on commit d6a3bf0.

@lewis6991
Copy link
Owner

Can you test #1034

@huibosa
Copy link

huibosa commented Jun 7, 2024

Can you test #1034

Tested, it works

@adwaymalhotra
Copy link

adwaymalhotra commented Jun 7, 2024

I can confirm that the issue is fixed at HEAD now. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
5 participants