如果我想找出两个差异之间的差异,为什么不能只找到diff两个差异?
我已经测试过
diff diff1 diff2,interdiff diff1 diff2没有发现输出有任何差异。在什么情况下它们会有所不同?
(我完全知道 interdiff 的既定目的是找到两个补丁之间的更改。)
Cod*_*ard -2
interdiff 创建统一格式 diff 来表达两个 diff 之间的差异。
差异必须都相对于相同的文件。
为了获得最佳结果,差异必须至少具有三行上下文。
Aninterdiff是补丁格式的文本文件,描述补丁的两个版本之间的更改。使用interdiffs 是最佳实践,可以让审阅者专注于补丁迭代中引入的更改,从而节省时间并减少乏味。
每当您更新问题队列中的重要补丁时,您都应该提供一个(它将被 Drupal.org 测试机器人忽略,因此请确保您也始终上传完整补丁)。
//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
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1702 次 |
| 最近记录: |