Thread (4 messages) flat view 4 messages, 2 authors, 2016-06-15

Re: let git-diff allow patch to delete empty files?

From: Sam Liddicott <hidden>
Date: 2016-06-15 22:45:36

* Sam Liddicott wrote, On 05/11/08 12:22:
quoted hunk ↗ jump to hunk
In some cases "patch" cannot apply diff's generated using git-diff, I've
had a "git diff" output look like this when an empty file was removed as
the only change:

..
However this equivalent pair works by making the file non-empty and then
deleting it.

diff -Nru 1/here 2/here
--- 1/here    2008-11-05 09:43:55.000000000 +0000
+++ 2/here    2008-11-05 09:43:58.000000000 +0000
@@ -0,0 +1 @@
+
diff -Nru 1/here 2/here
--- 1/here    2008-11-05 09:37:23.000000000 +0000
+++ 2/here    1970-01-01 01:00:00.000000000 +0100
@@ -1 +0,0 @@
-
  
The same problem occurs with new empty files.

Attached is an awk filter which will expand out these git notes into the
2-part unified diff's.
It would be nicer if git did it natively.
Sam

Attachments

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help