twaugh / patchutils

Manipulate patch files
GNU General Public License v2.0
139 stars 22 forks source link

combinediff is setting incorrect paths to files #53

Open Roo4L opened 2 years ago

Roo4L commented 2 years ago

Hi! I've face a bug during execution of combinediff. Let's say I have following first and second patch files: first.patch

--- a/file.c
+++ b/file.c
@@ -0,0 +1,3 @@
+a
+b
+c

second.patch

--- a/file.c
+++ b/file.c
@@ -1,3 +1,2 @@
 a
 b
-c

After executing combinediff -p1 first.patch second.patch I get the following output:

diff -u b/file.c b/file.c
--- b/file.c
+++ b/file.c
@@ -0,0 +1,2 @@
+a
+b

As you see, the path to the first file is b instead of a. I understand that it doesn't affect patch applying, but it breaks the convention used by almost all package vendors. Hope you would have a chance to fix it. Thanks in advance!

samatcodeapprove commented 1 year ago

I have seen this as well!

samatcodeapprove commented 1 year ago

@Roo4L I think have a fix here: https://github.com/twaugh/patchutils/pull/56

sergiomb2 commented 1 year ago

Cool , I will try test it this weekend , and give some feedback

malhal commented 6 months ago

what command did you use to make those patch files? My diff has different output.