Skip to content

combinediff: /dev/null is not handled correctly #23

Closed

Description

@vicencb

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ç.

Activity

  1. isidroas commented on Jun 5, 2024

    @isidroas

    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
  2. added 2 commits that reference this issue on Aug 20, 2025
    493dde8
    c872477
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions