git diff 与 opendiff 给出“无法启动 FileMerge”错误

发布于 2024-10-17 17:33:59 字数 443 浏览 3 评论 0原文

我将 git 配置为使用 ~/bin/opendiff-git.sh 作为我的外部 diff 工具。该脚本如下所示:

opendiff $2 $5

当我尝试从命令行执行 git diff 时,我收到以下消息:

2011-02-18 13:58:55.532 opendiff[27959:60f] exception raised trying to run FileMerge: launch path not accessible
2011-02-18 13:58:55.535 opendiff[27959:60f] Couldn't launch FileMerge
external diff died, stopping at source/some_file.m.

发生了什么事?这已经工作了好几个月了,但最近停止工作了。

I have git configured to use ~/bin/opendiff-git.sh as my external diff tool. That script looks like this:

opendiff $2 $5

When I try and do a git diff from the command line, I get this message:

2011-02-18 13:58:55.532 opendiff[27959:60f] exception raised trying to run FileMerge: launch path not accessible
2011-02-18 13:58:55.535 opendiff[27959:60f] Couldn't launch FileMerge
external diff died, stopping at source/some_file.m.

What's going on? This has worked for many months, but stopped working recently.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

奈何桥上唱咆哮 2024-10-24 17:33:59

因此,在我删除了 beta 开发人员文件夹以尝试解决此问题(无法修复与合并工具一起使用)后,我在命令行中偶然发现了这一点:

Error: No developer directory found at /Developer Beta. Run /usr/bin/xcode-select to update the developer directory path.

原来您可以设置您需要它使用的开发人员路径:

Usage: xcode-select -print-path
   or: xcode-select -switch <xcode_folder_path>
   or: xcode-select -version
Arguments:
   -print-path                     Prints the path of the current Xcode folder
   -switch <xcode_folder_path>     Sets the path for the current Xcode folder
   -version  

看起来就像安装测试版一样,自动将该路径设置为测试版。要修复它,请运行以下命令:

sudo /usr/bin/xcode-select -switch /Developer

这为我修复了它。

下面更新

Ying 的评论非常重要,足以包含在答案中。从 Xcode 4.3 开始,该文件夹的位置已更改为应用程序包内:

sudo /usr/bin/xcode-select -switch /Applications/Xcode.app/Contents/Developer/

So AFTER I deleted the beta developer folder to try and solve this (couldn't get the fix to work with merge tool) I stumbled upon this in the command line:

Error: No developer directory found at /Developer Beta. Run /usr/bin/xcode-select to update the developer directory path.

Turns out you can set the developer path you need it to use:

Usage: xcode-select -print-path
   or: xcode-select -switch <xcode_folder_path>
   or: xcode-select -version
Arguments:
   -print-path                     Prints the path of the current Xcode folder
   -switch <xcode_folder_path>     Sets the path for the current Xcode folder
   -version  

Looks like installing the beta had automatically set that path to beta. To fix it, run this:

sudo /usr/bin/xcode-select -switch /Developer

That fixed it for me.

Update

Ying's comment below was important enough to include in the answer. From Xcode 4.3 on, the location of the folder has changed to inside the application package:

sudo /usr/bin/xcode-select -switch /Applications/Xcode.app/Contents/Developer/
帥小哥 2024-10-24 17:33:59

如果您安装了两个 SDK,并且最新(可能是测试版)版本未安装系统工具,则 opendiff 等某些工具可能会崩溃。您一次只能安装一组系统工具,因此您必须选择哪个 SDK/安装有它。我通过使用安装了系统工具的 Developer 文件夹中的 opendiff 路径解决了这个问题。

就我而言,我安装了以下 Xcode:

当前稳定版本(安装了系统工具)

/Developer

最新测试版(未安装系统工具)

/Developer (iOS SDK XXX beta)

我的 ~/bin/ opendiff-git.sh 脚本现在看起来像这样:

"/Developer/usr/bin/opendiff" $2 $5

If you have two SDKs installed, and the latest (presumably beta) version doesn't have the System Tools installed, some tools like opendiff can break. You can only have one set of System Tools installed at a time, so you have to choose which SDK/installation has it. I fixed this problem by using the path of opendiff that is in the Developer folder that had the system tools installed.

In my case, I have the following Xcode installations:

Current stable release (with System Tools installed)

/Developer

Latest beta (without System Tools installed)

/Developer (iOS SDK XXX beta)

My ~/bin/opendiff-git.sh script now looks like this:

"/Developer/usr/bin/opendiff" $2 $5
寂寞陪衬 2024-10-24 17:33:59

首先是xcode的安装路径从4.3开始修改了,所以必须重新选择xcode路径

完整指南在下面的链接中:
http://useyourloaf.com/blog/2012/2 /17/更新到xcode-43.html

first the reason is xcode's installation path modified since 4.3, so must reselect xcode path

full guide is in below link:
http://useyourloaf.com/blog/2012/2/17/updating-to-xcode-43.html

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文