Re: [PATCH 8/8] cache-tree: avoid path comparison loop when silent
- From
Derrick Stolee <stolee@gmail.com>
- Date
- Jan 6, 2021, 12:08 UTC
- Message-ID
- <9df34ae5-2be0-40b8-b1e3-0198e3dcef53@gmail.com>
- In-Reply-To
- <xmqqble2sav9.fsf@gitster.c.googlers.com>
On 1/6/2021 3:55 AM, Junio C Hamano wrote:
Show 20 quoted lines
> Elijah Newren <newren@gmail.com> writes:
>
>> Looking through that code, I come to the same conclusion, though it
>> might be nice to have Junio confirm (and to explain the "if (10 <
>> ++funny)" section; did that help debugging too?). The second part of
>> the loop was part of his initial commit adding the cache-tree
>> extension in commit 749864627c ("Add cache-tree.", 2006-04-23)
>
> This is not about debugging our implementation. The verification
> was done to protect against the on-disk index file left by broken
> implementations of other people. Either JGit or Dulwich (I do not
> recall which one) used to have such a broken sort long time ago,
> IIRC, and the thing is, a broken implementation can be internally
> consistent.
>
> I do not think we've heard problem reports discovered by this check
> about other peoples' broken implementation, but a chicken-and-egg is
> certainly in action here. The check would have caught any new and
> broken implementation of Git before it got released to the wild to
> cause harm and that is probably we haven't heard.Thanks for the additional context. I think the performance enhancements in v2 are enough to satisfy me for now without completely removing the functionality.
Thanks, -Stolee