Open echasnovski opened 2 years ago
For anyone with same problem: I seem to have managed to overcome this with lazygit --git-dir=$(git rev-parse --git-dir)
. Made an alias and works fine at the moment.
This started appearing again in 0.40
for me. --git-dir doesn't event work...
Works fine with 0.39.4
This started appearing again in
0.40
for me. --git-dir doesn't event work... Works fine with0.39.4
Yeah, for me too. Had to spend about an hour to find the issue. Seems like something changed with how worktrees are handled.
I updated the alias to be lazygit --git-dir=$(git rev-parse --git-dir) --work-tree=$(realpath .)
. Works fine like this for me.
Thanks @echasnovski, that solved it!
Hmm.. lazygit starts under PR #3183, but the symlinking in this issue appears to be a confusing case re: the normal submodule cases documented there. When cd'ed into the linked submodule, the correct behavior should be to show the submodule repo's info. Instead, lazygit thinks it's in the parent repo.
Correction: see next comment.
Correction: #3183 appears to work correctly for this case. I added a test case "doubleLinkedSubmoduleCase" to repotest.zsh that builds a repository with a two-level nested submodule, and a symlink into the inner submodule, ala:
repo/outerSubmodule/innerSubmodule
Lazygit works when cd'ing into a symlink in repo
:
outerSubmodule
outerSubmodule/innerSubmodule
I believe no. 2 matches the repro for this issue. If not, I'd love a correction so I can craft a repro scenario.
Lazygit still has issues when cd'ing into a subdirectory of innerSubmodule via a symlink, but I believe that's effectively part of lazygit's known issues with running from repo subdirs.
Describe the bug When intending to use inside submodule of a symlinked submodule, there is this error with latest release (version 0.34):
Everything works in the following scenarios:
This seems like it should have been fixed in #789, but, unfortunately, I don't see this working.
To Reproduce Steps to reproduce the behavior:
lazygit
(I see error).For more context, this happens inside my dotfiles. It has submodule
neovim/.config/nvim
(link to repo), which I symlink to~/.config/nvim
while dotfiles are in~/dotfiles
. Thenvim
submodule in turn has many own submodules for plugins (inpack/plugins/opt
directory). So trying to runlazygit
:~/.config/nvim/pack/plugins/opt/gitsigns
).~/dotfiles/neovim/.config/nvim/pack/plugins/opt/gitsigns
).~/.config/nvim/pack/plugins/opt
).Expected behavior
lazygit
can start in submodule of symlinked submodule.Screenshots No screenshot.
Desktop (please complete the following information):
lazygit --version
).Additional context Add any other context about the problem here.