git difftool stopped working and I have no idea why.
# git difftool --tool=vimdiff
error: cannot run git-difftool--helper: No such file or directory
fatal: external diff died, stopping at ...
vimdiff
is installed on /bin/vimdiff
and working correctly.
# vimdiff --version
VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Aug 9 2019 03:17:15)
- The same problem happens when replacing the
--tool
to something other thanvimdiff
. - It happens on any repo on that machine, so it’s not a repo specific problem.
- Tried to reinstall git by
yum reinstall git222-core.x86_64
. The reininstall succeeded but the problem persists. git difftool
used to work in the past on the same machine, so my guess is that something changed in the machine’s configuration and causes this.- Other git commands (status, diff, commit, push, etc) work correctly. The problem seems to be limited to git difftool.
git version is 2.22.3, running on CentOS Linux release 7.7.1908 (Core)
Any idea what could be wrong and how to further debug this?
3
Answers
Thanks to @phd comment, I found out that the file
/usr/lib/git-core/git-difftool--helper
was missing.Possibly missing in the git package itself, since reinstalling git did not solve this.
So I downloaded it from git repo (the same tag as my git version):
Moved (and renamed it) to
/usr/lib/git-core/git-difftool--helper
, chmod a+x, and now it's working.Update 1
Opened an issue on ius git222
Update 2
According to @carlwgeorge who maintains git222 on ius, git-difftool--helper is part of
git222
and notgit222-core
.This can be verified like this:
And after running
yum install git222
, git-difftool--helper is restored:The IUS git222 package was forked from the Fedora git package. It follows the same layout, with a minimal set of functionality in the git222-core package, and the rest of the functionality (and all their dependencies) in the main git222 package. This hasn’t changed in the lifecycle of git222, so the most likely situation is that someone thought they only needed git222-core and thus uninstalled git222. To get that functionality back, install git222 again.
I Fixed This Problem
Go to the location where Visual Studio has created installed Git:
That folder requires update with 2 files:
git-difftool--helper
git-mergetool--lib
So we will update them.
git-difftool--helper
, with the following content:git-mergetool--lib
, to have the following content: