Instantly share code, notes, and snippets.

Embed
What would you like to do?
diff dealing with absent vs. present newline when new code is appended
# diff -c 1.txt 2.txt
*** 1.txt 2012-11-03 23:24:05.000000000 -0400
--- 2.txt 2012-11-03 23:24:13.000000000 -0400
***************
*** 1,2 ****
foo
! bar
\ No newline at end of file
--- 1,3 ----
foo
! bar
! baz
\ No newline at end of file
# diff -c 1-newline.txt 2-newline.txt
*** 1-newline.txt 2012-11-03 23:24:55.000000000 -0400
--- 2-newline.txt 2012-11-03 23:25:06.000000000 -0400
***************
*** 1,2 ****
--- 1,3 ----
foo
bar
+ baz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment