sindrets / diffview.nvim

Single tabpage interface for easily cycling through diffs for all modified files for any git rev.
Other
3.57k stars 101 forks source link

[Bug] Neovim 0.10 error when no VCS is found and diffview is called #500

Closed charbelnicolas closed 1 month ago

charbelnicolas commented 1 month ago

Description

When calling diffview when there is no VCS enabled it throws an error.

Expected behavior

Show a simple warning that there is no VCS enabled on the current file or project.

Actual behavior

ss_2024_05_21_23_03_11

Steps to reproduce

Open neovim 0.10 and open diffview

Health check

==============================================================================
diffview: require("diffview.health").check()

Checking plugin dependencies ~
- WARNING Optional dependency 'nvim-web-devicons' not found.

Checking VCS tools ~
- The plugin requires at least one of the supported VCS tools to be valid.
- OK Git found.
- OK Git is up-to-date. (2.45.1)
- WARNING Configured `hg_cmd` is not executable: 'hg'

Log info

[INFO  2024-05-21 -1:07:38.375 -0500] ...ite/pack/packer/start/diffview.nvim/lua/diffview/lib.lua:24: [command call] :DiffviewOpen 
[ERROR 2024-05-21 -1:07:38.385 -0500] ...ite/pack/packer/start/diffview.nvim/lua/diffview/job.lua:329: Job exited with a non-zero exit code: 128
[ERROR 2024-05-21 -1:07:38.385 -0500] ...art/diffview.nvim/lua/diffview/vcs/adapters/git/init.lua:173: [job-info] Exit code: 128
[ERROR 2024-05-21 -1:07:38.385 -0500] ...art/diffview.nvim/lua/diffview/vcs/adapters/git/init.lua:173:      [cmd] git 'rev-parse' '--path-format=absolute' '--show-toplevel'
[ERROR 2024-05-21 -1:07:38.385 -0500] ...art/diffview.nvim/lua/diffview/vcs/adapters/git/init.lua:173:      [cwd] /home/charbel
[ERROR 2024-05-21 -1:07:38.385 -0500] ...art/diffview.nvim/lua/diffview/vcs/adapters/git/init.lua:173:   [stderr] fatal: not a git repository (or any of the parent directories): .git
[ERROR 2024-05-21 -1:07:38.389 -0500] ...ite/pack/packer/start/diffview.nvim/lua/diffview/job.lua:329: Job exited with a non-zero exit code: 128
[ERROR 2024-05-21 -1:07:38.389 -0500] ...art/diffview.nvim/lua/diffview/vcs/adapters/git/init.lua:173: [job-info] Exit code: 128
[ERROR 2024-05-21 -1:07:38.389 -0500] ...art/diffview.nvim/lua/diffview/vcs/adapters/git/init.lua:173:      [cmd] git 'rev-parse' '--path-format=absolute' '--show-toplevel'
[ERROR 2024-05-21 -1:07:38.389 -0500] ...art/diffview.nvim/lua/diffview/vcs/adapters/git/init.lua:173:      [cwd] /home/charbel
[ERROR 2024-05-21 -1:07:38.389 -0500] ...art/diffview.nvim/lua/diffview/vcs/adapters/git/init.lua:173:   [stderr] fatal: not a git repository (or any of the parent directories): .git
[ERROR 2024-05-21 -1:07:38.390 -0500] ...tart/diffview.nvim/lua/diffview/vcs/adapters/hg/init.lua:53: [HgAdapter] Configured `hg_cmd` is not executable: 'hg'

Neovim version

NVIM v0.11.0-dev-49+g10601ac5fa
Build type: RelWithDebInfo
LuaJIT 2.1.1713773202

Operating system and version

Linux 6.9.1-arch1-1 x86_64 GNU/Linux

Minimal config

No response