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 worktrees don't work #83

Open
kekscode opened this issue Mar 21, 2023 · 3 comments
Open

git worktrees don't work #83

kekscode opened this issue Mar 21, 2023 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@kekscode
Copy link

Describe the bug

A clear and concise description of what the bug is:

  • Cloned a repo in --bare and added main branch as git worktree add
  • Hoped the default configuration would work
  • Getting Failed to get closest revision in that exists in remote 'origin' error

To Reproduce

  • Provide a minimal lua configuration that reproduces the bug:

...just the default config with no changes to mappings, callbacks or anything else is fine.

  • Describe the steps to reproduce the behavior:
  1. Do git clone --bare https://github.com/ruifm/gitlinker.nvim && cd gitlinker.nvim.git && git worktree add main
  2. Change to main and open a file there, e.g. README.md
  3. press <leader>gy (default mapping). The error Failed to get closest revision in that exists in remote 'origin' should appear.

Expected behavior
Open README.md for main branch of 'ruifm/gitlinker.nvim' on GitHub.

System (please complete the following information):

  • OS: macos
  • git version 2.37.1 (Apple Git-137.1)
  • Neovim:
NVIM v0.8.3
Build type: Release
LuaJIT 2.1.0-beta3
Compiled by brew@Ventura-arm64.local

Features: +acl +iconv +tui
See ":help feature-compile"

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/opt/homebrew/Cellar/neovim/0.8.3/share/nvim"

Run :checkhealth for more info
@kekscode kekscode added the bug Something isn't working label Mar 21, 2023
lnc3l0t added a commit to lnc3l0t/gitlinker.nvim that referenced this issue May 19, 2023
A new option has been added to config: bare_repos. It is a list of pairs { git_dir, git_work_tree }.
If the plugin is used in a buffer which belongs to a bare repository, after the first call to git (`git rev-parse`)
which returns error since buffer is not in a git repo, subsequent similar calls will be made with the `--git-dir` and
`--git-work-tree` flags.
After the buffer has been found to be in one of the bare repositories the user added to the config the information is
cached for subsequent calls in the session
lnc3l0t added a commit to lnc3l0t/gitlinker.nvim that referenced this issue May 19, 2023
A new option has been added to config: bare_repos. It is a list of pairs { git_dir, git_work_tree }.
If the plugin is used in a buffer which belongs to a bare repository, after the first call to git (`git rev-parse`)
which returns error since buffer is not in a git repo, subsequent similar calls will be made with the `--git-dir` and
`--work-tree` flags.
After the buffer has been found to be in one of the bare repositories the user added to the config the information is
cached for subsequent calls in the session
stevanmilic pushed a commit to stevanmilic/gitlinker.nvim that referenced this issue Nov 12, 2023
@linrongbin16
Copy link

hi @kekscode , let's track this issue here: linrongbin16/gitlinker.nvim#107

@msharran
Copy link

Is this being worked on?

@linrongbin16
Copy link

hi @msharran, let's track it here: linrongbin16/gitlinker.nvim#107

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

4 participants