Re: [PATCH v4 2/3] apply: make i-t-a entries never match worktree
- From
Raymond E. Pasco <ray@ameretat.dev>
- Date
- Aug 6, 2020, 21:47 UTC
- Message-ID
- <C4Q8SABARPKO.3TGSLMINT377S@ziyou.local>
- In-Reply-To
- <xmqqimdvjxq1.fsf@gitster.c.googlers.com>
On Thu Aug 6, 2020 at 5:00 PM EDT, Junio C Hamano wrote:
Show 6 quoted lines
> At first glance, it feels somewhat sad that this check is not done > in check_preimage(); after all, the caller of check_preimage() feeds > it to all kind of patches, without excluding path creation, so the > helper should be allowed to say "heh, you are trying to create path > F with this patch, but there already is F in the index", "you are > renaming into F but there is F already", etc.
I spent some time trying to put it in there before deciding it was better off in check_to_create().
Show 5 quoted lines
> It is somewhat unsatisfactory that we need to do the same > index_name_pos probing twice. I wonder if we somehow can > consolidate them? > > Perhaps something along this line, instead of this patch?
I think this logic can be consolidated and still readable, yeah. I'll send a patch.