Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@jjb
Created November 4, 2012 03:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jjb/4010082 to your computer and use it in GitHub Desktop.
Save jjb/4010082 to your computer and use it in GitHub Desktop.
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