TFS 下的 MS Office 文件差异

发布于 2024-11-06 03:16:49 字数 246 浏览 4 评论 0原文

当您在 Team Foundation Server 源资源管理器中比较两个版本的 MS Word doc/Excel 书籍时,结果是无聊的“二进制填充不同”对话框。

但事实并非一定如此。相关应用程序(Word/Excel)具有出色的内置差异界面。当您使用启用版本控制的 SharePoint 文件库并与以前的版本进行比较时,您可以见证这一点。另外,当您进行比较时,TortoiseSVN 会显示它。

问题 - 我可以在 TFS 中启用此功能吗?

When you compare two versions of MS Word doc/Excel book in Team Foundation Server Source Explorer, the result is the boring "Binary filles differ" dialog.

It does not have to be that way though. The relevant apps (Word/Excel) have an excellent built-in diff interface. You can witness it when you work with versioning-enabled SharePoint file library and do compare with a previous version. Also, TortoiseSVN brings it up when you do diffs.

Question - can I enable this in TFS?

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

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

发布评论

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

评论(3

纵性 2024-11-13 03:16:49

您可以为每个文件类型(扩展名)配置比较(diff)和合并工具。这可以通过工具->;选项->源代码控制 -> Visual Studio Team Foundation 服务器 ->配置用户工具”按钮或通过命令行使用tf diff /configure

为了设置比较工具,您将指定扩展名(使用 .*(如果您希望它用于所有未另行指定的文件)、您正在设置的操作(比较或合并)、要调用的命令以及命令的参数。参数中,可用的变量如下:

%1 = Original file (in diff, the pre-changes file, in merge, the "server" or "theirs" file, the file that is the base file after "their" changes were applied)
%2 = Modified file (in diff, the post-changes file, in merge the "yours" file - the base file with "your" changes applied)
%3 = Base file (in the 3-way merge operation, the file which both "theirs" and "yours" are derived from - the common ancestor.  This doesn't mean it's the version the changes were based from, since this may be a cherry-pick merge)
%4 = Merged file (The output file for the merge operation - the filename that the merge tool should write to)
%5 = Diff options (any additional command-line options you want to pass to your diff tool - this comes into play only when using "tf diff /options" from the command-line)
%6 = Original file label (The label for the %1 file)
%7 = Modified file label (The label for the %2 file)
%8 = Base file label (The label for the %3 file)
%9 = Merged file label (The label for the %4 file)

要使用 TortoiseSVN(看起来它可以实现您想要的功能),您可以将命令指定为 TortoiseMerge.exe 的文件路径。

为了进行比较,请指定参数:/base:%1 /mine:%2 /basename:%6 /minename:%7

对于合并,请指定参数:/base:%3 /mine:%2 /theirs:%1 /basename:%8 /minename:%7 /theirsname:%6 /merged:%4 /mergedname:%9

有关各种合并工具参数的此信息和其他信息(包括其他单词比较)可以在 詹姆斯·曼宁的 MSDN 博客。您还可以在另一个 stackoverflow 问题中使用 调用命令行中的单词比较工具

You can configure comparison (diff) and merge tools per file type (extension). This is available via Tools -> Options -> Source Control -> Visual Studio Team Foundation Server -> Configure User Tools" button or via the command-line with tf diff /configure

In order to set up a comparison tool, you'll specify the extension (use .* if you want it to be used for all files not otherwise specified), the operation you're setting up (Compare or Merge), the command to invoke and the arguments to the command. For arguments, the variables available for use are the following:

%1 = Original file (in diff, the pre-changes file, in merge, the "server" or "theirs" file, the file that is the base file after "their" changes were applied)
%2 = Modified file (in diff, the post-changes file, in merge the "yours" file - the base file with "your" changes applied)
%3 = Base file (in the 3-way merge operation, the file which both "theirs" and "yours" are derived from - the common ancestor.  This doesn't mean it's the version the changes were based from, since this may be a cherry-pick merge)
%4 = Merged file (The output file for the merge operation - the filename that the merge tool should write to)
%5 = Diff options (any additional command-line options you want to pass to your diff tool - this comes into play only when using "tf diff /options" from the command-line)
%6 = Original file label (The label for the %1 file)
%7 = Modified file label (The label for the %2 file)
%8 = Base file label (The label for the %3 file)
%9 = Merged file label (The label for the %4 file)

To use TortoiseSVN -- which seems like it does what you want -- you would specify the command as the file path to TortoiseMerge.exe

For comparisons, specify the arguments: /base:%1 /mine:%2 /basename:%6 /minename:%7

For merges, specify the arguments: /base:%3 /mine:%2 /theirs:%1 /basename:%8 /minename:%7 /theirsname:%6 /merged:%4 /mergedname:%9

This and other information on the arguments for various merge tools (including other word comparison tools like DiffDoc.exe) can be found on James Manning's MSDN blog. You may also find use in another stackoverflow question on invoking the word comparison tool from the command line.

吲‖鸣 2024-11-13 03:16:49

您还可以在 TFS 中使用 WinMerge + xdocdiff 插件,应用以下两个步骤:

  1. 将 WinMerge 与 VS-TFS 关联:http://manual.winmerge.org/Version_control.html#d0e9669

  2. 在 WinMerge 中启用 xdocdiff 插件:http://freemind.s57.xrea.com/xdocdiffPlugin/en/index.html

这样,您还可以使用 xdocdiff 支持的所有文件类型。

You can also use WinMerge + xdocdiff plugin in TFS, apply these two steps:

  1. Associate WinMerge with VS-TFS: http://manual.winmerge.org/Version_control.html#d0e9669

  2. Enable xdocdiff plugin in WinMerge: http://freemind.s57.xrea.com/xdocdiffPlugin/en/index.html

This way, you will also be able to use all file types that xdocdiff supports.

没︽人懂的悲伤 2024-11-13 03:16:49

现在我认为最好的方法是使用MS Word比较,它比其他文档比较工具要好得多(MS Word本机支持比较,除了合并)。
通过使用 (https://github.com/ForNeVeR/ExtDiff) 提供的 powershell 脚本,可以触发 MS 字比较功能 insde TFS 比较。为了解决PS执行策略问题,需要修改diff-word.cmd中的内容,添加“-ExecutionPolicy Bypass”。引入“diff-word.cmd”进行.docx比较后,效果非常好。

The best way now I thought is to use MS Word compare which is much better than other doc diff tools (MS word native support compare except merge).
By using a powershell script which is provided by (https://github.com/ForNeVeR/ExtDiff), you can trigger the MS word compare function insde TFS compare. In order to solve the PS execution policy issue, you need to alter the content in diff-word.cmd by adding "-ExecutionPolicy Bypass". After introudce the "diff-word.cmd" for .docx compare, it works very well.

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