Closed azzamsa closed 1 month ago
How large in terms of commits are we talking here?
Now, It happens to almost all my repo.
function M.neogit_open(path)
print("path before neogit open = " .. path)
require("neogit").open({ cwd = path })
end
path before neogit open = /home/my/dotfiles
...share/nvim/lazy/plenary.nvim/lua/plenary/async/async.lua:18: The coroutine failed with this message: .../share/nvim/lazy/neogit/lua/neogit/lib/git/sequencer.lua:50: attempt to index local 'HEAD_oid' (a nil value)
stack traceback:
[C]: in function 'error'
...share/nvim/lazy/plenary.nvim/lua/plenary/async/async.lua:18: in function 'callback_or_next'
this is the full log
...share/nvim/lazy/plenary.nvim/lua/plenary/async/async.lua:18: The coroutine failed with this message: .../share/nvim/lazy/neogit/lua/neogit/lib/git/sequencer.lua:50: attempt to index local 'HEAD_oid' (a nil value)
stack traceback:
[C]: in function 'error'
...share/nvim/lazy/plenary.nvim/lua/plenary/async/async.lua:18: in function 'callback_or_next'
...share/nvim/lazy/plenary.nvim/lua/plenary/async/async.lua:45: in function 'cb'
...msa/.local/share/nvim/lazy/neogit/lua/neogit/process.lua:299: in function <...msa/.local/share/nvim/lazy/neogit/lua/neogit/process.lua:264>
...share/nvim/lazy/plenary.nvim/lua/plenary/async/async.lua:18: The coroutine failed with this message: .../share/nvim/lazy/neogit/lua/neogit/lib/git/sequencer.lua:50: attempt to index local 'HEAD_oid' (a nil value)
stack traceback:
[C]: in function 'error'
...share/nvim/lazy/plenary.nvim/lua/plenary/async/async.lua:18: in function 'callback_or_next'
...share/nvim/lazy/plenary.nvim/lua/plenary/async/async.lua:45: in function 'cb'
...msa/.local/share/nvim/lazy/neogit/lua/neogit/process.lua:299: in function <...msa/.local/share/nvim/lazy/neogit/lua/neogit/process.lua:264> function: builtin#18 ...share/nvim/lazy/plenary.nvim/lua/plenary/async/async.lua:18: The coroutine failed with this message: .../share/nvim/lazy/neogit/lua/neogit/lib/git/rev_parse.lua:11: Missing oid
stack traceback:
[C]: in function 'error'
...share/nvim/lazy/plenary.nvim/lua/plenary/async/async.lua:18: in function 'callback_or_next'
...share/nvim/lazy/plenary.nvim/lua/plenary/async/async.lua:45: in function 'cb'
...msa/.local/share/nvim/lazy/neogit/lua/neogit/process.lua:299: in function <...msa/.local/share/nvim/lazy/neogit/lua/neogit/process.lua:264>
...share/nvim/lazy/plenary.nvim/lua/plenary/async/async.lua:18: The coroutine failed with this message: .../share/nvim/lazy/neogit/lua/neogit/lib/git/sequencer.lua:50: attempt to index local 'HEAD_oid' (a nil value)
stack traceback:
[C]: in function 'error'
...share/nvim/lazy/plenary.nvim/lua/plenary/async/async.lua:18: in function 'callback_or_next'
...share/nvim/lazy/plenary.nvim/lua/plenary/async/async.lua:45: in function 'cb'
...msa/.local/share/nvim/lazy/neogit/lua/neogit/process.lua:299: in function <...msa/.local/share/nvim/lazy/neogit/lua/neogit/process.lua:264> function: builtin#18 ...share/nvim/lazy/plenary.nvim/lua/plenary/async/async.lua:18: The coroutine failed with this message: .../share/nvim/lazy/neogit/lua/neogit/lib/git/rev_parse.lua:11: Missing oid
stack traceback:
[C]: in function 'error'
...share/nvim/lazy/plenary.nvim/lua/plenary/async/async.lua:18: in function 'callback_or_next'
...share/nvim/lazy/plenary.nvim/lua/plenary/async/async.lua:45: in function 'cb'
...msa/.local/share/nvim/lazy/neogit/lua/neogit/process.lua:299: in function <...msa/.local/share/nvim/lazy/neogit/lua/neogit/process.lua:264> function: builtin#18 ...share/nvim/lazy/plenary.nvim/lua/plenary/async/async.lua:18: The coroutine failed with this message: .../share/nvim/lazy/neogit/lua/neogit/lib/git/sequencer.lua:50: attempt to index local 'HEAD_oid' (a nil value)
stack traceback:
[C]: in function 'error'
...share/nvim/lazy/plenary.nvim/lua/plenary/async/async.lua:18: in function 'callback_or_next'
...share/nvim/lazy/plenary.nvim/lua/plenary/async/async.lua:45: in function 'cb'
...msa/.local/share/nvim/lazy/neogit/lua/neogit/process.lua:299: in function <...msa/.local/share/nvim/lazy/neogit/lua/neogit/process.lua:264>
...share/nvim/lazy/plenary.nvim/lua/plenary/async/async.lua:18: The coroutine failed with this message: .../share/nvim/lazy/neogit/lua/neogit/lib/git/sequencer.lua:50: attempt to index local 'HEAD_oid' (a nil value)
stack traceback:
[C]: in function 'error'
...share/nvim/lazy/plenary.nvim/lua/plenary/async/async.lua:18: in function 'callback_or_next'
...share/nvim/lazy/plenary.nvim/lua/plenary/async/async.lua:45: in function 'cb'
...msa/.local/share/nvim/lazy/neogit/lua/neogit/process.lua:299: in function <...msa/.local/share/nvim/lazy/neogit/lua/neogit/process.lua:264> function: builtin#18 ...share/nvim/lazy/plenary.nvim/lua/plenary/async/async.lua:18: The coroutine failed with this message: .../share/nvim/lazy/neogit/lua/neogit/lib/git/rev_parse.lua:11: Missing oid
stack traceback:
[C]: in function 'error'
...share/nvim/lazy/plenary.nvim/lua/plenary/async/async.lua:18: in function 'callback_or_next'
...share/nvim/lazy/plenary.nvim/lua/plenary/async/async.lua:45: in function 'cb'
...msa/.local/share/nvim/lazy/neogit/lua/neogit/process.lua:299: in function <...msa/.local/share/nvim/lazy/neogit/lua/neogit/process.lua:264> function: builtin#18 ...share/nvim/lazy/plenary.nvim/lua/plenary/async/async.lua:18: The coroutine failed with this message: .../share/nvim/lazy/neogit/lua/neogit/lib/git/sequencer.lua:50: attempt to index local 'HEAD_oid' (a nil value)
stack traceback:
[C]: in function 'error'
...share/nvim/lazy/plenary.nvim/lua/plenary/async/async.lua:18: in function 'callback_or_next'
...share/nvim/lazy/plenary.nvim/lua/plenary/async/async.lua:45: in function 'cb'
...msa/.local/share/nvim/lazy/neogit/lua/neogit/process.lua:299: in function <...msa/.local/share/nvim/lazy/neogit/lua/neogit/process.lua:264> function: builtin#18 ...share/nvim/lazy/plenary.nvim/lua/plenary/async/async.lua:18: The coroutine failed with this message: .../share/nvim/lazy/neogit/lua/neogit/lib/git/rev_parse.lua:11: Missing oid
stack traceback:
[C]: in function 'error'
...share/nvim/lazy/plenary.nvim/lua/plenary/async/async.lua:18: in function 'callback_or_next'
...share/nvim/lazy/plenary.nvim/lua/plenary/async/async.lua:45: in function 'cb'
...msa/.local/share/nvim/lazy/neogit/lua/neogit/process.lua:299: in function <...msa/.local/share/nvim/lazy/neogit/lua/neogit/process.lua:264>
If you don't do the cwd flag, i presume it works fine?
Yes, it is.
But I need to do :cd <path>
beforehand.
I believe it is a regression because I have been using Neogit cwd=<path>
for almost a year without any issues.
My current workaround is to fire Neogit cwd=...
repeatedly until it works. But usually, it only took twice.
Current temporary workaround:
nvim .
inside the neovideneovide . &
or nvim .
from there.Fixed in https://github.com/NeogitOrg/neogit/pull/1489 by @Strongleong
I relly depend on cwd argument in my work and this issue drives me nuts
Same here, I switched back to Emacs because of this one issue. I rely heavily on cwd
for my workflow.
Thank you so much @Strongleong
Description
Sometimes I get
Head: 0000000 (no commits)
on large repos, sometimes it is not. I can't do anything but to close-and-reopen nvim and then invoke Neogit again until it succeded.Neovim version
🦄 nvim --version NVIM v0.10.0 Build type: Release LuaJIT 2.1.1713484068 Run "nvim -V1 -v" for more info
🦄 neovide --version neovide 0.13.3
Operating system and version
Fedora Linux 40 (Workstation Edition) x86_64
Steps to reproduce
"neogit": { "branch": "master", "commit": "2b74a777b963dfdeeabfabf84d5ba611666adab4" },
require("neogit").open({ cwd = path })
.Head: 0000000 (no commits)
Expected behavior
Display git status correctly
Actual behavior
I get
Head: 0000000 (no commits)
insteadMinimal config