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

git worktree list throws error #6

Open
heytrav opened this issue Dec 30, 2023 · 7 comments
Open

git worktree list throws error #6

heytrav opened this issue Dec 30, 2023 · 7 comments
Labels
bug Something isn't working

Comments

@heytrav
Copy link

heytrav commented Dec 30, 2023

I've been struggling to get this to work and after spending quite a bit of time re-reading the docs here I am not sure what it is I am doing wrong.

The create_git_worktree command works ok. However when I try to run the git_worktrees() command as explained in the README I get the following stacktrace:

:lua require('telescope').extensions.git_worktree.git_worktrees()                                                                                                                                          
E5108: Error executing lua ...l/share/nvim/lazy/telescope.nvim/lua/telescope/utils.lua:226: Expected Lua number
stack traceback:
        [C]: in function 'nvim_win_get_width'
        ...l/share/nvim/lazy/telescope.nvim/lua/telescope/utils.lua:226: in function 'calc_result_length'
        ...l/share/nvim/lazy/telescope.nvim/lua/telescope/utils.lua:285: in function 'transform_path'
        ...worktree.nvim/lua/telescope/_extensions/git_worktree.lua:166: in function 'parse_line'
        ...worktree.nvim/lua/telescope/_extensions/git_worktree.lua:179: in function 'git_worktrees'
        [string ":lua"]:1: in main chunk

I'm using Lazy for my package manager and here is my configuration to install it:

  {
    url = "[email protected]:polarmutex/git-worktree.nvim.git",
    opts = {
      change_directory_command = "tcd",
    },
  },

Any suggestions would be appreciated.

@polarmutex
Copy link
Owner

the command works for me on the main branch. can you double check you are running the latest commit on the main branch?

@heytrav
Copy link
Author

heytrav commented Jan 2, 2024

From the output of :Lazy check it looks like I am:

    ● git-worktree.nvim 3.43ms  start
        dir     /home/travis/.local/share/nvim/lazy/git-worktree.nvim
        url     [email protected]:polarmutex/git-worktree.nvim
        version 1.0.0
        tag     1.0.0
        branch  main
        commit  b6f0631
        readme  README.md


@polarmutex
Copy link
Owner

polarmutex commented Jan 2, 2024

ok, I will try to reproduce it on my end

think this is the issue ThePrimeagen/issues/112

@heytrav
Copy link
Author

heytrav commented Jan 2, 2024

ok, I will try to reproduce it on my end

think this is the issue ThePrimeagen/issues/112

Yes that works for me as well. I switched my config to use that for and no longer get the error. Thanks!

@heytrav heytrav closed this as completed Jan 2, 2024
@jtackaberry
Copy link

@polarmutex would you consider reopening this? @heytrav closed the issue because he applied the workaround, but I would really like to preserve path_display = { "truncate" } with Telescope, which is the root cause of this issue.

@polarmutex polarmutex reopened this Mar 16, 2024
@polarmutex
Copy link
Owner

I will try to fix this when I get some time

@polarmutex
Copy link
Owner

think this is fixed on the version I released today (v2). I put the PR fix in my devel branch for the next version if it does not

@polarmutex polarmutex added the bug Something isn't working label Jul 18, 2024
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
Development

No branches or pull requests

3 participants