让 svn 根据文件扩展名自动检测 diff-cmd 和 diff3-cmd

发布于 2024-12-06 05:18:12 字数 327 浏览 0 评论 0原文

在 Git 中,可以在 .gitattributes 中指定这些并执行一些附加配置:

git config diff.difftool.command ...
git config merge.mergetool.driver ...

在 Mercurial 中,可以在 hgrc 文件中指定模式 ([diff-patterns]< /code> 和 [merge-patterns] 部分)。

如何在 Subversion 中实现这一点?

In Git one can specify these in .gitattributes and perform some additional configuration:

git config diff.difftool.command ...
git config merge.mergetool.driver ...

In Mercurial it is possible to specify patterns in hgrc file ([diff-patterns] and [merge-patterns] sections).

How to achieve this in Subversion?

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

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

发布评论

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

评论(1

迷鸟归林 2024-12-13 05:18:12

Subversion 红皮书 (通常是所有知识的来源)这里不太具体。它指出可以选择配置 diff-cmddiff3-cmd,并且可以向呼叫添加扩展。

然而,它指出以下内容:

何时触发上下文两向或三向差异作为较大 Subversion 操作的一部分完全由 Subversion 做出,并且除其他因素外,还受到正在操作的文件是否是人类可读的影响由它们的 svn:mime-type 属性决定。这意味着,即使您拥有世界上最出色的 Microsoft Word 感知差异或合并工具,只要您的版本化 Word 文档具有已配置的 MIME 类型(表明它们不是),Subversion 就永远不会调用它。人类可读(例如 application/msword)。

它没有说明如何影响该决定:-(

如果您使用 TortoiseSVN 工具,则包含配置选项来指定所考虑文件的每个 mime 类型所使用的 diff 工具。该配置的路径是: TortoiseSVN > 设置 > 差异查看器 > 高级...


我个人认为您应该使用包装器。无论如何 diff-tool ,并根据 mime 类型决定使用哪种工具和哪种特定配置。

The red-book for Subversion (normally the source of all knowledge) is not too specific here. It names that there is the option to configure diff-cmd and diff3-cmd and that it is possible to add extensions to the call.

However, it states the following:

The decision on when to fire off a contextual two- or three-way diff as part of a larger Subversion operation is made entirely by Subversion and is affected by, among other things, whether the files being operated on are human-readable as determined by their svn:mime-type property. This means, for example, that even if you had the niftiest Microsoft Word-aware differencing or merging tool in the universe, it would never be invoked by Subversion as long as your versioned Word documents had a configured MIME type that denoted that they were not human-readable (such as application/msword).

It does not say how to influence that decision :-(

If you are using the tool TortoiseSVN, there are configuration options included to specify the used diff tool per mime-type of the file under consideration. The path to that configuration is: TortoiseSVN > Settings > External Programs > Diff Viewer > Advanced.... Perhaps that is an option for you.


My personal opinion here is that the subversion team thinks that you should use a wrapper as diff-tool anyway, and to do there the decision what tool to use with which specific configuration based on the mime-type.

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