如何使用 Beyond Compare 作为外部 svn diff 工具

发布于 2024-08-08 05:24:56 字数 117 浏览 5 评论 0原文

我想配置它,以便 svn diff 文件名显示无法比较的差异。

我在ubuntu上。在相关说明中,每个人都使用什么来比较和合并。 BC 在 Windows 上很棒,但在 Linux 上看起来很丑,我认为。

I want to configure it so that svn diff filename shows the diff in beyond compare.

I am on ubuntu. On a related note what is everyone using to diff and merge. BC is awesome on windows, but very ugly looking on Linux, imo.

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

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

发布评论

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

评论(3

独自唱情﹋歌 2024-08-15 05:24:56

就像其他答案所说的那样——你必须从脚本中调用 Beyond Compare 并将其传递给 subversion 的 --diff-cmd 选项。我在 Linux 上使用以下脚本:

#!/bin/bash
test `/usr/bin/bcompare "$6" "$7" -title="$3" -title2="$5" -readonly` > 2 && exit 1; exit 0

这与 CooCooC 帖子中的链接所说的类似,只是它将 Beyond Compare 的返回值转换为 subversion 期望的值:0 表示没有差异,1 表示差异。这消除了错误消息和中止,否则会妨碍您...

编辑:请参阅下面的 colgur 评论,更好的方法是:

/usr/bin/bcompare "$7" "$6" -title1="$5" -title2="$3" -readonly & wait $! 
[ $? -gt 2 ] && exit 1; exit 0

Like the other answers have said -- you have to call beyond compare from a script and pass that to subversion's --diff-cmd option. I use the following script on linux:

#!/bin/bash
test `/usr/bin/bcompare "$6" "$7" -title="$3" -title2="$5" -readonly` > 2 && exit 1; exit 0

That's similar to what the link in CooCooC's post says, except that it translates the return value of beyond compare into what subversion expects: 0 for no difference, 1 for difference. That gets rid of the error messages and aborts that otherwise get in your way...

EDIT: See colgur's comment below, a better way to do it is:

/usr/bin/bcompare "$7" "$6" -title1="$5" -title2="$3" -readonly & wait $! 
[ $? -gt 2 ] && exit 1; exit 0
活泼老夫 2024-08-15 05:24:56

请参阅有关外部差异工具的 SVN 书籍

存在 --diff-cmd--diff3-cmd 选项,以及类似命名的运行时配置参数(请参阅 名为“Config”的部分),可以导致关于使用外部差异(或“diff”)和 Subversion 合并工具是多么容易的错误观念。虽然 Subversion 可以使用大多数流行的此类工具,但在设置此工具时投入的精力往往并非微不足道。

...

在 Subversion 中使用外部比较和合并工具(当然不是 GNU diff 和 diff3)的关键是使用包装脚本,将 Subversion 的输入转换为差异工具可以理解的内容,然后将将你的工具的输出恢复为 Subversion 期望的格式——GNU 工具将使用的格式。以下部分介绍了这些期望的具体内容。

See the SVN Book on External Diff Tools:

The presence of --diff-cmd and --diff3-cmd options, and similarly named runtime configuration parameters (see the section called “Config”), can lead to a false notion of how easy it is to use external differencing (or “diff”) and merge tools with Subversion. While Subversion can use most of popular such tools available, the effort invested in setting this up often turns out to be non-trivial.

...

The key to using external diff and merge tools (other than GNU diff and diff3, of course) with Subversion is to use wrapper scripts which convert the input from Subversion into something that your differencing tool can understand, and then to convert the output of your tool back into a format which Subversion expects—the format that the GNU tools would have used. The following sections cover the specifics of those expectations.

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