Open kimabrandt opened 1 week ago
More precisely:
The error is (sometimes) happening with both enabled and disabled debug_mode
. Only with debug_mode
enabled, the Error executing luv callback
and stack traceback
are shown. In both cases, the right hand side diff-file, is (sometimes) not attached to. I guess, this is when the error happens!?
Here's a fix, how I would imagine it to work. It fixes both the error and my suggested change; ignore files inside the /tmp/git-blob-*
-directory:
diff --git a/lua/gitsigns/git.lua b/lua/gitsigns/git.lua
index bec3d35..f81cf2c 100644
--- a/lua/gitsigns/git.lua
+++ b/lua/gitsigns/git.lua
@@ -399,6 +399,10 @@ function Obj.new(file, revision, encoding, gitdir, toplevel)
log.dprint('In git dir')
return nil
end
+ if vim.fn.fnamemodify(file, ":h"):match("^/tmp/git[-]blob[-]") then
+ log.dprint('Outside repository')
+ return nil
+ end
if not vim.startswith(file, '/') and toplevel then
file = toplevel .. util.path_sep .. file
I havn't yet figured out - why/how at 19.99
in the Gitsigns debug messages - the command is pairing a work-tree (toplevel)
and a file
, that cause the fatal: /tmp/gitsigns_issue/file: '/tmp/gitsigns_issue/file' is outside repository at '/tmp/git-blob-Wbd6Ch'
-error!?
Description
With installed
which-key
-plugin and gitsignsdebug_mode
enabled, gitsigns - most of the time, but not always - gives the following error, when usinggit difftool
(withdebug_mode
disabled, this only happens sometimes, without the error and stack traceback):Neovim version
NVIM v0.10.1 Build type: Release LuaJIT 2.1.1720049189
Operating system and version
NAME="Arch Linux" BUILD_ID=rolling
Expected behavior
No error should be shown, even though it's non-critical.
Actual behavior
It seems, as if gitsigns did not attach to the file on the right; the file inside the repository!? This also happens with disabled
debug_mode
.On the other hand, gitsigns seems to always attach - also with disabled
debug_mode
- to the file on the left; the/tmp/git-blob-<random>/<filename>
. I'm not sure if this is the expected behavior or not?! Since I could imagine, that it should be ignored by gitsigns!? This may be unrelated to this issue!?Minimal config
Steps to reproduce
mkdir gitsigns_issue
cd gitsigns_issue
git init
touch file
git add file
git commit -m 'initial commit'
nvim minimal.lua
git config difftool.gsvimdiff.cmd 'nvim --clean -u minimal.lua -d "$LOCAL" "$REMOTE"'
git config difftool.prompt false
echo 123 > file
nvim --clean -u minimal.lua -cq
git difftool --tool=gsvimdiff
Gitsigns debug messages
Gitsigns cache