Re: [PATCH v5 2/3] apply: make i-t-a entries never match worktree
- From
- Phillip Wood <phillip.wood123@gmail.com>
- Date
- Aug 9, 2020, 15:25 UTC
- Message-ID
- <e52f7048-45ab-1f5e-1b04-30bd9b98d9b2@gmail.com>
- In-Reply-To
- <C4RQMTXM9R7C.1WK5637SFISUU@ziyou.local>
Hi Raymond
On 08/08/2020 16:58, Raymond E. Pasco wrote:
Show 11 quoted lines
> On Sat Aug 8, 2020 at 11:48 AM EDT, Phillip Wood wrote: >> If I've understood correctly an i-t-a entry in the index combined with >> nothing in the worktree is a deletion and that is why we don't want >> --index to succeed when applying a creation patch? If so an expanded >> explanation in the commit message to this patch would help rather than >> just saying 'by definition'. I'm still a bit confused as we don't count >> it as a deletion when using --cached or applying to the worktree. > > Nothing that complicated - --index requires that the index and worktree > be identical, and nothing that can possibly be in a worktree is > identical to an i-t-a entry.
Oh, so --index requires the index and worktree to match and the worktree cannot represent i-t-a so they don't match. I'm still not totally convinced that it is useful to prevent a creation patch from applying when the path is missing from the worktree but is marked as i-t-a in the index but I guess it matches the behavior the general behavior where a patch can be successfully applied with 'apply' and 'apply --cached' but not with 'apply --index'
Show 9 quoted lines
>>> --check goes through all the same code, >> >> The same code as --cached or --index? (I assume it's the former but >> wanted to be sure) > > "--cached --check" goes through the same code paths as "--cached", > "--cached --index" goes through the same code paths as "--index", > "--check" goes through the same code paths as [no options]. The option > just makes it skip the part where it writes things out.
Thanks for clarifying that
Best Wishes
Phillip