FWIW, GNU diff includes newlines in its diff output as part of the context of the diff:

```
pete@balloon:/tmp$ echo -e "foo" > foo
pete@balloon:/tmp$ echo -e "bar" > bar
pete@balloon:/tmp$ git diff foo bar
diff --git a/foo b/bar
index 257cc56..5716ca5 100644
--- a/foo
+++ b/bar
@@ -1 +1 @@
-foo
+bar
pete@balloon:/tmp$ echo -e "foo\n" > foo
pete@balloon:/tmp$ echo -e "bar\n" > bar
pete@balloon:/tmp$ git diff foo bar
diff --git a/foo b/bar
index 75d7bfb..9972d7e 100644
--- a/foo
+++ b/bar
@@ -1,2 +1,2 @@
-foo
+bar
 
pete@balloon:/tmp$
```