Skip to content

empty context lines don't have the prefixing space char #35

@correabuscar

Description

@correabuscar

on gnu diff and git diff every empty context line has one space as the prefix for the line, thus the line isn't empty in the patch itself, for example:

(to see this, start selecting with the mouse from 3 to -4, u'll see the extra space)

gnu diff:

--- /tmp/a	2024-08-08 22:29:37.810523528 +0200
+++ /tmp/b	2024-08-08 22:29:41.627190227 +0200
@@ -2,4 +2,4 @@
 2
 3
 
-4
+5

git diff:

--- /tmp/a	2024-08-08 22:29:37.810523528 +0200
+++ /tmp/b	2024-08-08 22:29:41.627190227 +0200
@@ -2,4 +2,4 @@
 2
 3
 
-4
+5

diffy:

--- /tmp/a
+++ /tmp/b
@@ -2,4 +2,4 @@
 2
 3

-4
+5

However applying the patch works fine with either empty context line or prefixed with space context line. (at least, gnu patch does)

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