patchutils icon indicating copy to clipboard operation
patchutils copied to clipboard

combinediff: /dev/null is not handled correctly

Open vicencb opened this issue 6 years ago • 1 comments

Hi, when combining two patches where the first one creates a new file

--- /dev/null
+++ b/txt
@@ -0,0 +1,3 @@
+a
+b
+c

and the second one modifies that same file

--- a/txt
+++ b/txt
@@ -1,3 +1,2 @@
 a
 b
-c

then combinediff outputs

unchanged:
--- /dev/null
+++ b/txt
@@ -0,0 +1,3 @@
+a
+b
+c
only in patch2:
unchanged:
--- a/txt
+++ b/txt
@@ -1,3 +1,2 @@
 a
 b
-c

that is, the patches are not combined.

Regards,   Vicenç.

vicencb avatar May 13 '18 22:05 vicencb

I also see this.

That device (/dev/null) is used by git to express a file addition or deletion.

The expected output is

--- /dev/null
+++ b/txt
@@ -0,0 +1,2 @@
+a
+b

isidroas avatar Jun 05 '24 15:06 isidroas