interdiff做的差异不能做什么? [英] What does interdiff do that diff cannot?

查看:111
本文介绍了interdiff做的差异不能做什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我试图找到两个差异之间的差异,为什么我不能 diff 这两个差异?

If I'm trying to find the diff between two diffs, why can't I just diff the two diffs?


我已测试 diff diff1 diff2 interdiff diff1 diff2 并且没有在输出中找到任何差异。在什么情况下,它们会不同?

I have tested diff diff1 diff2 and interdiff diff1 diff2 and have not found any difference in the output. In what case would they be different?

(我完全知道interdiff声明的目的是找到两个补丁之间的变化。)

(I am fully aware that interdiff's stated purpose is to find the changes between two patches.)

推荐答案

interdiff - 显示两个diff文件之间的差异



interdiff - show differences between two diff files


interdiff创建一个表示两个差异之间差异的统一格式差异。

差异必须都是相对于相同文件。

为获得最佳结果,差异必须至少有三行上下文。

interdiff creates a unified format diff that expresses the difference between two diffs.
The diffs must both be relative to the same files.
For best results, the diffs must have at least three lines of context.






一个 interdiff 是一个补丁格式的文本文件,它描述了两个版本的补丁之间的变化。使用 interdiff s是最佳实践,通过允许他们专注于修补程序迭代中引入的更改,节省时间并减少审阅者的繁琐工作。


An interdiff is a text file in patch format that describes the changes between two versions of a patch. Using interdiffs is a best practice that saves time and reduces tedium for reviewers by allowing them to focus on just the changes introduced in patch iterations.

每当您更新问题队列中的重要补丁时,您应该提供一个补丁(它将被Drupal.org测试机器人忽略,因此请确保始终上传完整

使用git创建interdiff



You should supply one whenever you update a significant patch in the issue queues (it will be ignored by the Drupal.org Testbots, so make sure that you always upload the full patch too).

//Always pull the latest changes.
git pull --rebase

//Create a branch for the old patch.
git checkout -b my_first_branch

// Download the old version of the patch you wish 
// to update and apply it to your local git repository.
git apply --index patchname.patch

// Commit the changes from the old patch.
git commit -m "my_first_branch"

// Depending on how you like to work, you now have a choice between
// two options. If you do not yet have a new patch created, you can now
// create a new branch.
git checkout -b my_second_branch

// Otherwise, let's go back to the mainline branch and create a 
// new branch to patch from.
git checkout any_reuired_commit_id
git checkout -b my_second_branch

// Make your changes on the new branch (e.g. apply your new patch), 
// then commit the changes.
git commit -m "my_second_branch"

// Generate the interdiff by comparing the current (new) branch against 
// the old branch.
git diff my_first_branch > interdiff-my_first_branch-[new_comment_number].txt

// You can create the updated patch easily at this point with:
git diff any_reuired_commit_id > my_second_branch.patch

这篇关于interdiff做的差异不能做什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆