Re: [PATCH] midx: traverse the local MIDX first
- From
Derrick Stolee <stolee@gmail.com>
- Date
- Aug 28, 2020, 18:27 UTC
- Message-ID
- <9a599bb5-fb6f-1e35-6e02-d62703ebc420@gmail.com>
- In-Reply-To
- <20200828180621.GA9036@nand.nand.local>
On 8/28/2020 2:06 PM, Taylor Blau wrote:
Show 11 quoted lines
> This invariant is only preserved by the insertion order in > 'prepare_packed_git()', which traverses through the ODB's '->next' > pointer, meaning we visit the local object store first. This fragility > makes this an undesirable long-term solution, but it is acceptable for > now since this is the only caller. > > Signed-off-by: Taylor Blau <me@ttaylorr.com> > --- > This is kind of a hack, but the order that we call > 'prepare_multi_pack_index_one()' from 'prepare_packed_git()' makes it > acceptable, at least in my own assessment.
The natural alternative would be to scan the list _after_ all are inserted and pull any MIDX marked "local" to the front of the list. Such a check would need to happen in the same method that iterates over all alternates, so that seems a bit redundant.
While perhaps a bit hack-ish, I think this is a sound approach. And, we have a test that will detect change in behavior here!
Thanks, -Stolee