4
1
I'm on Linux Mint 17 64-bit. Just purged git
and re-installed with apt
. Deleted ~/.gitconfig
. Only configuration I do after supposedly fresh install is (while inside a repo)
git config diff.tool vimdiff
Then I run
git difftool HEAD:switch-monitor.sh master:switch-monitor.sh
and get
fatal: cannot exec 'git-difftool--helper': Bad address
external diff died, stopping at HEAD:switch-monitor.sh.
So I remove the pertinent line from .git/config
and try the command again, and sure enough the built in basic git diff
works.
I've also tried the instructions in this tutorial: http://technotales.wordpress.com/2009/05/17/git-diff-with-vimdiff/
That leads to a slightly different but similar error. I place the following in a new ~/.gitconfig
[diff]
external = git_diff_wrapper
[pager]
diff =
And place and make executable a git_diff_wrapper
file on my PATH
, and run
git diff HEAD:switch-monitor.sh master:switch-monitor.sh
And get
fatal: cannot exec 'git_diff_wrapper': Bad address
external diff died, stopping at HEAD:switch-monitor.sh.
However, it seems to have nothing to do with the content of git_diff_wrapper
. I placed
#!/bin/bash
echo hello
Into it and that doesn't change anything. However, if I remove the file or rename it, then I do get this
error: cannot run git_diff_wrapper: No such file or directory
external diff died, stopping at HEAD:switch-monitor.sh.
Note it says "No such file or directory" instead of "Bad address" in this case.
I've searched and can't find an instance of a similar problem online.
Update
I'm getting the same problem in a fresh install of Ubuntu 14.04 on a virtual machine
Update
I've spent some time looking at git's source, and I'm pretty sure errno
is getting set to EFAULT
("Bad address"), in the course of this function:
static int execv_shell_cmd(const char **argv)
{
const char **nargv = prepare_shell_cmd(argv);
trace_argv_printf(nargv, "trace: exec:");
sane_execvp(nargv[0], (char **)nargv);
free(nargv);
return -1;
}
Which calls this:
int sane_execvp(const char *file, char * const argv[])
{
if (!execvp(file, argv))
return 0; /* cannot happen ;-) */
/*
* When a command can't be found because one of the directories
* listed in $PATH is unsearchable, execvp reports EACCES, but
* careful usability testing (read: analysis of occasional bug
* reports) reveals that "No such file or directory" is more
* intuitive.
*
* We avoid commands with "/", because execvp will not do $PATH
* lookups in that case.
*
* The reassignment of EACCES to errno looks like a no-op below,
* but we need to protect against exists_in_PATH overwriting errno.
*/
if (errno == EACCES && !strchr(file, '/'))
errno = exists_in_PATH(file) ? EACCES : ENOENT;
else if (errno == ENOTDIR && !strchr(file, '/'))
errno = ENOENT;
return -1;
}
Any ideas?
Thanks
I have the same problem on renamed files with git difftool -C --tool=meld -Y master Without the -C flag, it doesn't crash (but it doesn't see renames neither...) – user3819503 – 2015-02-14T08:02:47.937