$ 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).
为什么会出现模糊和行位移?这是一个演示案例,旨在理解diff和patch,因为工具有时/经常不像预期一样工作。