用 diff 来比较 diff?

发布于 2024-08-17 13:37:26 字数 144 浏览 2 评论 0原文

我需要知道这两个补丁是否实际上相同。

我有一个旧的补丁文件和使用 unix diff 命令创建的新补丁文件。只需比较补丁即可报告由于创建补丁时的时间戳而产生的差异。

有没有一种方法(使用 diff?)可以可靠地告诉我这两个补丁是否实际上相同?

I need to know if the two patches are effectively the same.

I have an old patch file and new patch file created with the unix diff command. Just diff'ing the patches reports differences due to the timestamp when the patch was created.

Is there a way (with diff?) that can reliably tell me if the two patches are effectively the same?

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

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

发布评论

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

评论(3

惟欲睡 2024-08-24 13:37:26

使用 interdiff 来自 patchutils

空心空情空意 2024-08-24 13:37:26

您可以将两个补丁应用到同一源文件的副本,然后通常使用 diff 来检查结果中的差异。

补丁表示对输入文件的更改,因此如果两个补丁对输入文件具有相同的效果,则它们是相同的。补丁的差异直接反映在这些补丁结果的差异上。

两个补丁之间的任何差异如果不会导致这些补丁的结果存在差异,则都是无关紧要的。

You could apply both patches to copies of the same source file and then use diff normally to check for differences in the results.

Patches represent changes to the input files, so two patches are the same if they have the same effect on the input files. Differences in patches are directly reflected in differences of the results of those patches.

Any differences between two patches that don't result in a difference in the result of those patches are irrelevant.

神经大条 2024-08-24 13:37:26

您可以尝试超越比较

它可以配置为用其他内容替换一个或两个文件中的字符串,然后它会在幕后执行此操作。屏幕上的文件看起来仍然像存在于磁盘上一样,但差异取决于处理的文件。

这样,您可以将其配置为将具有时间戳等格式的所有文本更改为两个文件中常见的格式,然后您只需比较其他所有内容。

在 Windows 客户端中,要更改这些设置,工具栏中有一个带有小符号的按钮,看起来像一个人、躯干和头部,在打开的对话框中,有一个“替换”选项卡。

You could try Beyond Compare.

It can be configured to replace strings in one or both files with something else, which it then does under the covers. The files on screen still look like they exist on disk, but the differences are according to the processed files.

With that you can configure it to change all text that has a format like a timestamp to something common in both files, and then you'll only compare everything else.

In the Windows client, to change these settings, in the toolbar there is a button with a small symbol that looks like a man, torso and head, and in the dialog that opens, there is a tab for Replacements.

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