私は Linux Mint 17 64 ビットを使用しています。 を削除しgit
て再インストールしましたapt
。 削除しました~/.gitconfig
。 新規インストール後に行う唯一の設定は (リポジトリ内で)
git config diff.tool vimdiff
それから私は走る
git difftool HEAD:switch-monitor.sh master:switch-monitor.sh
そして
fatal: cannot exec 'git-difftool--helper': Bad address
external diff died, stopping at HEAD:switch-monitor.sh.
そこで、関連する行を削除し.git/config
てコマンドを再度試してみたところ、確かに組み込みの基本git diff
機能が動作することがわかりました。
このチュートリアルの手順も試してみました:http://technotales.wordpress.com/2009/05/17/git-diff-with-vimdiff/
これは少し異なるが同様のエラーにつながります。次のコードを新しい~/.gitconfig
[diff]
external = git_diff_wrapper
[pager]
diff =
git_diff_wrapper
そして、ファイルを私の上に配置して実行可能にしPATH
、実行する。
git diff HEAD:switch-monitor.sh master:switch-monitor.sh
そして
fatal: cannot exec 'git_diff_wrapper': Bad address
external diff died, stopping at HEAD:switch-monitor.sh.
しかし、それはの内容とは何の関係もないようですgit_diff_wrapper
。
#!/bin/bash
echo hello
何も変わりません。しかし、もし私が取り除くファイルを削除したり名前を変更したりすると、このようになります
error: cannot run git_diff_wrapper: No such file or directory
external diff died, stopping at HEAD:switch-monitor.sh.
この場合、「Bad address」ではなく「No such file or directory」と表示されることに注意してください。
検索してみましたが、オンラインで同様の問題の例を見つけることができませんでした。
アップデート
仮想マシンにUbuntu 14.04を新規インストールしても同じ問題が発生します
アップデート
私は git のソースを調べるのに時間を費やしましたが、この関数の過程で ("Bad address")errno
に設定されていることはほぼ確実です。EFAULT
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;
}
これは次のように呼び出されます:
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;
}
何か案は?
ありがとう
答え1
これは古いスレッドだとはわかっていますが、まだ閉じられていないようです...
私も同様のエラーに遭遇しました (vimdiff を使用して 2 つのコミットの違いを確認したいと考えていました)。私の場合は次の方法でうまくいきました: git difftool HEAD..HEAD~1 --path-to-file/file
乾杯
答え2
私の場合の解決策は、git 2.x にアップグレードすることでした。git 2.3.4 では、この問題は発生しなくなりました。
答え3
Ubuntu14 でも同じ問題が発生しましたが、git を v1.9.1 から v2.11.0 にアップグレードすることで解決しました。
アップグレードにはgitのメンテナーリポジトリを使用する必要がありました。ここ。