Changed diff3 view from 2.36 → 2.67 for vimdiff
- From
- Claudio Ebel <claudio.ebel@web.de>
- Date
- Jul 22, 2022, 07:48 UTC
- Message-ID
- <99c80fc2-0f94-a607-ca71-c45961c07e2b@web.de>
Hi all,
when solving a merge conflict using Git and Vim as mergetool, I get a totally different view than I expected and am used to. In the past, I followed this blog post (https://www.rosipov.com/blog/use-vimdiff-as-git-mergetool/), where the result is a view with four windows: LOCAL | BASE | REMOTE and then the file below. Now I get four windows as well, but LOCAL at the top and then LOCAL | LOCAL | file.
First I was not able to figure out if the problem lies within Git or Vim. I removed my global .gitconfig as well as the .vimrc but neither helped. What finally helped was to disguise the HOME directory for Git via this command:
$ git merge octodog $ HOME= git mergetool
My git version:
$ git --version git version 2.37.1
Then I tried older Git versions, 2.37.0 showed the same behavior but Git 2.36.1 showed the old view.
Minimal working example (for bash):
$ cd $(mktemp -d) $ git init $ # ––– config mergetool $ git config merge.tool vimdiff $ git config merge.conflictstyle diff3 $ git config mergetool.prompt false $ # ––– create merge conflict $ echo -e 'cat\ndog\noctopus\noctocat' > animals.txt $ git add animals.txt $ git commit -am 'Initial commit' $ git checkout -b octodog $ sed -i 's/octopus/octodog/' animals.txt $ git commit -am "Replace octopus with an octodog" $ git checkout master $ sed -i 's/octopus/octoman/' animals.txt $ git commit -am "Replace octopus with an octoman" $ # ––– trigger behavior $ git merge octodog $ git mergetool
How can I get the old view back? Is this a bug or a feature of Git? Should I write the Vim guys?
This behavior is independent of directory as well as host, it occurs on a different machine as well.
Thanks in advance, Claudio