Closed LamprosPitsillos closed 6 months ago
Why does git merge-base HEAD REBASE_HEAD
fail in your repo? Are HEAD
and REBASE_HEAD
unrelated histories?
Works fine on my end using the branches and reproduction steps you provided.
Are you able to reproduce the error on your own system, or was the error a one time thing?
git clone git@github.com:LamprosPitsillos/neovim.git --depth 1
git fetch origin ve_buf_set_text:ve_buf_set_text --depth=1
git switch ve_buf_set_text
git rebase master
nvim --clean -u mini.lua
:DiffviewOpen
Manages to reproduce the issue everytime
--depth=1
there's your problem.
You should never merge or rebase branches when you don't give Git enough history to work out the merge base. You will get ridiculous conflicts (as you do here). With sufficient history your example rebase introduces only one conflict. With --depth=1
you get >1000.
I understand the desire to use --depth
in order to reduce size on the FS. However, to correctly do a merge/rebase you should make sure that the two branches have all history dating back to at least the merge base. You can use i.e. --shallow-since='1 year'
with both git-fetch
and git-clone
.
Thank you very much for the insights on git and your time on this issue, properly cloning did solve the issue (along with many other issues i had) ! Thank you also for this amazing plugin, closing the issue
Description
I have branch A and Master I checkout to branch A and
git rebase master
Open neovim ( works with minimal config ) and openDiffviewOpen
Get the below error.Expected behavior
Open the Diffview so that i can solve the conflicts
Actual behavior
Steps to reproduce
git clone git@github.com:LamprosPitsillos/neovim.git --depth 1
git fetch origin ve_buf_set_text:ve_buf_set_text --depth=1
git switch ve_buf_set_text
git rebase master
nvim --clean -u mini.lua
:DiffviewOpen
Health check
Output of
``` diffview: require("diffview.health").check() Checking plugin dependencies ~ - OK nvim-web-devicons installed. 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.42.0) - WARNING Configured `hg_cmd` is not executable: 'hg' ```:checkhealth diffview
Log info
Relevant info from
``` [INFO 2024-01-09 11:14:52.645 +0200] ...local/share/nvim/lazy/diffview.nvim/lua/diffview/lib.lua:24: [command call] :DiffviewOpen [ERROR 2024-01-09 11:14:53.914 +0200] ...local/share/nvim/lazy/diffview.nvim/lua/diffview/job.lua:329: Job exited with a non-zero exit code: 1 [ERROR 2024-01-09 11:14:53.914 +0200] ...azy/diffview.nvim/lua/diffview/vcs/adapters/git/init.lua:328: [job-info] Exit code: 1 [ERROR 2024-01-09 11:14:53.914 +0200] ...azy/diffview.nvim/lua/diffview/vcs/adapters/git/init.lua:328: [cmd] git 'merge-base' 'HEAD' 'REBASE_HEAD' [ERROR 2024-01-09 11:14:53.914 +0200] ...azy/diffview.nvim/lua/diffview/vcs/adapters/git/init.lua:328: [cwd] /home/inferno/docs/Programming/NEOVIM/neovim ```:DiffviewLog
Neovim version
Operating system and version
OS: NixOS 24.05.20240102.bd645e8 (Uakari) x86_64
Minimal config