Subject: Re: [PATCH 3/3] index-pack: commit tree during outgoing link check

From: Jonathan Tan <[email-masked]>
Date: Mon, 9 Dec 2024 12:29:35 -0800

Junio C Hamano <[email-masked]> writes:
> >> > However, it is also possible for
> >> > the server to compute that it needs to send S and not O, and proceed
> >> > from there;
> >> 
> >> If O, C, and S have all identical trees, then wouldn't such a test
> >> work well?  At that point it does not matter which between O and C 
> >> the server bases its decision to send S but not S's tree on, no?
> >> 
> >> In any case, will queue.  Thanks.
> >
> > O has a different tree from C and S. I will add a note to clarify this.
> 
> No, that is not what I meant.  "If you arrange your test so that all
> three have the same tree, then would't the reason why such a test
> would not work you cited disappear and make this fix testable?" is
> what I wanted to ask.

Copying and pasting the diagram for reference:

 C   S
  \ /
   O

I looked into this and I don't think that making O, C, and S have the
same tree will make this fix testable. If they all had the same tree,
whether we check S's tree or not doesn't matter, since that tree is
already in a promisor pack (O and its tree was previously fetched from
the promisor remote, and thus is in a promisor pack). (We are checking
trees in order to repack them into promisor packs if necessary.)