$ vim patch
Index: toPatch
===================================================================
--- toPatch
+++ toPatch
@@ -2,4 +2,4 @@
*/
-final public class XMLWriter {
+public class XMLWriter {
$ vim toPatch
*/
final public class XMLWriter {
public static float CURRENT_VERSION=2.2f;
$ patch -p0 -ui patch
patching file toPatch
Hunk #1 succeeded at 1 with fuzz 2 (offset -1 lines).
为什么绒毛和线偏移?这是一个试图理解差异和补丁的演示案例,因为工具有时/通常不像预期的那样工作。为什么此修补程序应用了1的模糊,并且失败且模糊为0?
当时仍然不确定实际的问题..我刚刚搬到 – simpatico 2011-11-11 19:00:59
这发生在我身上时,将补丁文件内容复制/粘贴到我的编辑器中。一些行只有空格,但它们被修剪为空行,所以补丁文件应用正确,但有模糊因素警告...... – Julien 2016-01-27 15:33:13