Subject: Re: [PATCH/RFC 3/3] merge-recursive: Tolerate missing file when HEAD is up to date

From: Junio C Hamano <[email-masked]>
Date: Fri, 24 Jan 2014 11:50:39 -0800

Brad King <[email-masked]> writes:

> Teach add_cacheinfo to optionally tolerate make_cache_entry failure when
> the reason is ENOENT from lstat.  Tell it to do so in the call path when
> the entry from HEAD is known to be up to date.

It somehow feels wrong to force callers of make_cache_entry() to be
so intimate with the implementation details of refresh_cache_ent()
by having them inspect the errno from lstat(2) so deep in the
callchain, and to force callers of make_cache_entry() that says
refresh=NoThanks to pass a useless NULL.

Looking at refresh_cache_ent(), I notice that we already have cases
where we do not bother to lstat and instead say "Yeah, the cache
entry you have is good", and have to wonder if this new feature
should be modeled after them instead, namely, by introducing a new
option bit CE_MATCH_MISSING_OK that asks it to treat a path that is
missing from the working tree as if it is checked out unmodified.