git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

Previous: Taylor BlauNext: Jeff King
Message 2 of 10 in “midx: traverse the local MIDX first”
  1. midx: traverse the local MIDX firstTaylor Blau, Aug 28, 2020
  2. Derrick StoleeAug 28, 2020
  3. Jeff KingAug 28, 2020
  4. Jeff KingAug 28, 2020
  5. Derrick StoleeAug 28, 2020
  6. Taylor BlauAug 28, 2020
  7. Jeff KingAug 28, 2020
  8. Taylor BlauAug 28, 2020
  9. midx: traverse the local MIDX firstTaylor Blau, Aug 28, 2020
  10. Jeff KingAug 28, 2020

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.