-
-
Notifications
You must be signed in to change notification settings - Fork 51
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
When it involves in "No EOL at EOF", the current diff output can not be successfully applied via GNU patch
. The correct result can be generated by GNU diff
with
# for Context with extra one line context
# " | tail -n +3" removes those 2 file path headers
$ diff --context=1 old_file.txt new_file.txt | tail -n +3
# for Unified with extra one line context
# " | tail -n +3" removes those 2 file path headers
$ diff --unified=1 old_file.txt new_file.txt | tail -n +3
old_file.txt (no EOL at EOF):
A
B
X
new_file.txt (has EOL at EOF):
A
C
X
Our current outputs (Context):
***************
*** 1,3 ****
A
! B
X
--- 1,4 ----
A
! C
X
+
GNU diff (Context):
***************
*** 1,3 ****
A
! B
! X
\ No newline at end of file
--- 1,3 ----
A
! C
! X
Our current outputs (Unified):
@@ -1,3 +1,4 @@
A
-B
+C
X
+
GNU diff (Unified):
@@ -1,3 +1,3 @@
A
-B
-X
\ No newline at end of file
+C
+X
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working