polarmutex / git-worktree.nvim

MIT License
54 stars 14 forks source link

telescope window listing of worktrees not working #14

Open Antony-AXS opened 3 months ago

Antony-AXS commented 3 months ago

:lua require('telescope').extensions.git_worktree.git_worktrees() function is retuning empty list.

image

theIbraDev commented 3 months ago

same as #12 There's a fix for it in a pr on the origional repo

Antony-AXS commented 3 months ago

@theIbraDev the thing is there isn't any use in committing the changes locally, if i do :Lazy update the commit i made gets replaced with the original changes from the repo

theIbraDev commented 3 months ago

@theIbraDev the thing is there isn't any use in committing the changes locally, if i do :Lazy update the commit i made gets replaced with the original changes from the repo

You could do it as a local plugin with lazy, only issue is that you won't get updates. Not sure there will be

Antony-AXS commented 3 months ago

@theIbraDev the thing is there isn't any use in committing the changes locally, if i do :Lazy update the commit i made gets replaced with the original changes from the repo

You could do it as a local plugin with lazy, only issue is that you won't get updates. Not sure there will be @theIbraDev im not able to, i couldn't find the right way to load the plugin locally in lazy

Antony-AXS commented 3 months ago

@theIbraDev this is the error im getting when i try to call the plugin locally image this is the syntax i tried image

polarmutex commented 2 months ago

I will take a look at this soon, sorry been busy

polarmutex commented 2 months ago
:lua require('telescope').extensions.git_worktree.git_worktree()

should work on the v2 I just released. Let me know if you still have issues

Antony-AXS commented 2 months ago

it's still not listing created worktrees

polarmutex commented 2 months ago

in looking at your neovim configs I do not see you register the extension

require("telescope").load_extension("git_worktree")
Antony-AXS commented 2 months ago

image this error im getting for setting up the configuration below (highlighted function) image

Antony-AXS commented 2 months ago

Issues i see as of now:

  1. I'm not able to enter into the worktree that i want using telescope.
  2. not able to notify when i switch branches, it was possible earlier.
  3. the Directory listing is not redirecting after i switch to a branch
Antony-AXS commented 2 months ago

also git-worktree telescope doesn't work with the latest telescope version

polarmutex commented 2 months ago

I have made some updates to the API in v2 (please see the README)

but the following should work using the new API


require("telescope").load_extension("git-worktree")

local Hooks = require('git-worktree.hooks')
Hooks.register(Hooks.type.SWITCH, Hooks.builtins.update_current_buffer_on_switch)
Hooks.register(Hooks.type.SWITCH, function(path, prev_path)
    vim.notify("switched from " .. prev_path .. " to " .. path)
end)
Antony-AXS commented 2 months ago

thanks a lot this works.. but im getting error when deleting worktrees in telescope

Antony-AXS commented 2 months ago

also the path each new worktree i create is getting created in inside the previous worktree i created