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

telescope.create_git_worktree cannot fetch origin when working with passphrase protected ssh-keys #119

Open
j0giwa opened this issue Feb 12, 2024 · 1 comment

Comments

@j0giwa
Copy link

j0giwa commented Feb 12, 2024

If i clone a repository with ssh, and then want to create a new worktree via telescope, git cannot fetch origin because there is no way to enter the passphrase to unlock my ssh key.

Error executing luv callback:
.../nvim/lazy/git-worktree.nvim/lua/git-worktree/status.lua:63: 4 / 8: create_worktree Failed: PATH /mnt/d/Projekte/notetilus/urukai CMD { "fetch", "--all" } RES { "Fetching origin" }, ERR { "ssh_askpass: exec
(/usr/bin/ssh-askpass): No such file or directory", "[email protected]: Permission denied (publickey).", "fatal: Could not read from remote repository.", "", "Please make sure you have the correct access rights",
 "and the repository exists.", "error: Could not fetch origin" }
stack traceback:
        [C]: in function 'error'
        .../nvim/lazy/git-worktree.nvim/lua/git-worktree/status.lua:63: in function 'error'
        ...re/nvim/lazy/git-worktree.nvim/lua/git-worktree/init.lua:251: in function 'fn'
        .../.local/share/nvim/lazy/plenary.nvim/lua/plenary/job.lua:618: in function 'v'
        .../.local/share/nvim/lazy/plenary.nvim/lua/plenary/job.lua:244: in function '_shutdown'
        .../.local/share/nvim/lazy/plenary.nvim/lua/plenary/job.lua:47: in function <.../.local/share/nvim/lazy/plenary.nvim/lua/plenary/job.lua:38>
@seffradev
Copy link

I personally don't know how to solve this at the moment but I might give it a deeper look, but I have done some initial searching to get an idea on how to do it. Hopefully it might help somewhat.

What I gathered is that one problem when trying to solve this (I think, might only be netrw) is related to this StackOverflow question.

Yet tpope/vim-fugitive manages to prompt for SSH passphrase when doing e.g :G push. So creating/finding a lua-port of their code that handles the prompt might be a solution. This suggests the above problem is only related to netrw.

In the meantime, I suggest using the patch from #99 to disable automatic fetching on worktree creation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants