Thread (1 message) 1 message, 1 author, 2016-06-15

Re: [PATCH] builtin-apply: check for empty files when detecting creation patch

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:44:37

Linus Torvalds [off-list ref] writes:
On Tue, 13 May 2008, Junio C Hamano wrote:
quoted
With the change to remove the whole block, all tests still passes, and a
limited test with this:

        --- empty	2008-05-13 16:56:57.000000000 -0700
        +++ empty.1	2008-05-13 16:57:07.000000000 -0700
        @@ -0,0 +1 @@
        +foo

to update an originally empty file "empty" also seems to work.

However, with this change, it no longer allows you to accept such a patch
and treat it as a creation of "empty".  Instead we barf with "error:
empty: No such file or directory", if you do not have an empty "empty"
file in the work tree when you run "git apply" on the above patch.
Ok, that's a bug. It should *not* require that existing empty file, since 
"is_new" is -1. That's what -1 means: we don't know if it is new or not.

So I think your patch is correct, but we need to fix the thing that barfs 
to not barf if we don't know the status of "is_new"
Sorry for taking some time to follow this through (I've been busy with day
job).  Two patches follow this message to address this issue.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help