kdheepak / lazygit.nvim

Plugin for calling lazygit from within neovim.
MIT License
1.45k stars 52 forks source link

Submodule > lazyg opens for parent repo #47

Closed molleweide closed 2 years ago

molleweide commented 2 years ago

Hi there,

The other day I noticed that lazygit opens for the parent repo containing my submodule and not the submodule repo itself.

Is there a way to prevent this behaviour?

I can confirm that lazygit opens correctly for the submodule if I exit vim and run lazygit.

kdheepak commented 2 years ago

I think submodules and worktrees don't work correctly because I'm not passing the right directory to the invocation of lazygit. I'll look into this when I get the chance, but I'm swamped with a few other things at the moment.

molleweide commented 2 years ago

Thanks for replying man! I cloned the plugin to look at the source myself and see if I can figure it out. I am just learning how to get local plugin dev working. This might be a nice first thing to look into.

thefux commented 2 years ago

Hi, I noticed this issue also with submodules and I ended up writing a plugin for telescope (lazygit_telescope)... as u see below it list all git repository that are already opened with lazygit, and from there I switch to whatever I want, It still in Progress though but do what I'm I expecting it to do ... image (sorry for the background image :) )

also I did some working in the source code itself to make it work properly ! if anyone is interested I could improe it a bit and make a PR.

kdheepak commented 2 years ago

If you’d like to make a PR I’d super appreciate it! Or even if you can direct me to your fix, I can make a patch based on your suggestion.

thefux commented 2 years ago

@kdheepak, will do