lewis6991 / gitsigns.nvim

Git integration for buffers
MIT License
4.86k stars 186 forks source link

Error occurs when using nvim as git editor with git signs #1086

Closed Kaiser-Yang closed 1 month ago

Kaiser-Yang commented 1 month ago

Description

I use nvim as my git editor, when I use git commit, it gives me: image

I've tested that when removing the gitsigns plugin, the error messages will be gone.

Neovim version

0.10.0

Operating system and version

Ubuntu 22.04

Expected behavior

No response

Actual behavior

Error executing luv callback: 
 ...cal/share/nvim/lazy/gitsigns.nvim/lua/gitsigns/async.lua:85: The coroutine failed with this messaage: ...er/.local/share/nvim/lazy/gitsigns.nvim/lua/gitsigns.lua:34: attempt to index local 'info' (a nil value) 
 stack traceback: 
 ...er/.local/share/nvim/lazy/gitsigns.nvim/lua/gitsigns.lua: in function 'get_gitdir_and_head' 
 ...er/.local/share/nvim/lazy/gitsigns.nvim/lua/gitsigns.lua:54: in function <...er/.local/share/nviim/lazy/gitsigns.nvim/lua/gitsigns.lua:37> 
 stack traceback: 
 [C]: in function 'error' 
 ...cal/share/nvim/lazy/gitsigns.nvim/lua/gitsigns/async.lua:85: in function 'cb' 
 ...cal/share/nvim/lazy/gitsigns.nvim/lua/gitsigns/async.lua:127: in function 'on_exit' 
 /opt/nvim-linux64/share/nvim/runtime/lua/vim/_system.lua:300: in function </opt/nvim-linux64/share/nvim/runtime/lua/vim/_system.lua:270> 
 [C]: in function 'ui_attach' 
 .../.local/share/nvim/lazy/noice.nvim/lua/noice/ui/init.lua:77: in function 'enable' 
 ...ser/.local/share/nvim/lazy/noice.nvim/lua/noice/init.lua:69: in function 'enable' 
 ...ser/.local/share/nvim/lazy/noice.nvim/lua/noice/init.lua:23: in function <...ser/.local/share/nvvim/lazy/noice.nvim/lua/noice/init.lua:19> 
 [C]: in function 'xpcall' 
 ...local/share/nvim/lazy/noice.nvim/lua/noice/util/call.lua:149: in function 'try' 
 ...ser/.local/share/nvim/lazy/noice.nvim/lua/noice/init.lua:19: in function <...ser/.local/share/nvvim/lazy/noice.nvim/lua/noice/init.lua:18> 

Minimal config

require('gitsigns').setup()

Steps to reproduce

use git commit to open nvim with gitcommit files.

Gitsigns debug messages

No response

Gitsigns cache

No response

lewis6991 commented 1 month ago

Repro doesn't work.

Kaiser-Yang commented 1 month ago

Repro doesn't work.

All the configurations are available here, I don't know which part is actually wrong.

Kaiser-Yang commented 1 month ago

My git config:

[core]
    editor = nvim
    filemode = false
Kaiser-Yang commented 1 month ago

Repro doesn't work.

Oh, I've make a minimal to reproduce this: git-signs-reproduce

Kaiser-Yang commented 1 month ago

Just copy the .config to home diretory: image

Then make sure git editor is nvim, use git commit will reproduce: image

lewis6991 commented 1 month ago

Fixed in https://github.com/lewis6991/gitsigns.nvim/commit/e784e5a078f993f7218b8a857cb581d5b9ca42dc