polarmutex/git-worktree.nvim

telescope window listing of worktrees not working

Opened this issue ยท 15 comments

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

image

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

@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 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 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

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

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

:lua require('telescope').extensions.git_worktree.git_worktree()

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

it's still not listing created worktrees

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

require("telescope").load_extension("git_worktree")

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

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

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

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)

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

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