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

Re: [PATCH v2 0/3] builtin/repack: avoid rewriting up-to-date MIDX

From
Patrick Steinhardt <ps@pks.im>
Date
Dec 12, 2025, 07:33 UTC
Message-ID
<aTvFOlhtPHgWQC5L@pks.im>
In-Reply-To
<xmqqsedhe78q.fsf@gitster.g>
On Thu, Dec 11, 2025 at 05:46:13PM +0900, Junio C Hamano wrote:
Show 31 quoted lines
> This and Taylor's incremental part 3.2 have a slight conflict in
> that this topic factors away the logic to compute if we need
> recomputing MIDX while the other one tweaks with yet another flag.
> 
> My tentative resolution in 'seen' looks like the attached.  Sanity
> checking is very much appreciated.
> 
> Thanks.
> 
> diff --cc midx-write.c
> index ce459b02c3,f2dbacef4c..66c125ccb0
> --- a/midx-write.c
> +++ b/midx-write.c
> @@@ -1014,73 -1131,30 +1131,89 @@@ static void clear_midx_files(struct odb
>   	strbuf_release(&buf);
>   }
>   
>  +static bool midx_needs_update(struct multi_pack_index *midx, struct write_midx_context *ctx)
>  +{
>  +	struct strset packs = STRSET_INIT;
>  +	struct strbuf buf = STRBUF_INIT;
>  +	bool needed = true;
>  +
>  +	/*
>  +	 * Ignore incremental updates for now. The assumption is that any
>  +	 * incremental update would be either empty (in which case we will bail
>  +	 * out later) or it would actually cover at least one new pack.
>  +	 */
> - 	if (ctx->incremental)
> ++	if (ctx->incremental || ctx->compact)
>  +		goto out;

So this here is essentially the change you had to port over, which looks about right to me. The comment is becoming somewhat stale due to the change, but I don't think that's much of an issue for now.

Thanks!
Patrick
Previous: Junio C HamanoNext: Taylor Blau
Message 14 of 16 in “builtin/repack: avoid rewriting up-to-date MIDX”
  1. 0/2 builtin/repack: avoid rewriting up-to-date MIDXPatrick Steinhardt, Dec 8, 2025
  2. 1/2 midx: fix `BUG()` when getting preferred pack without a reverse indexPatrick Steinhardt, Dec 8, 2025
  3. Taylor BlauDec 10, 2025
  4. Patrick SteinhardtDec 10, 2025
  5. Taylor BlauDec 18, 2025
  6. 2/2 builtin/repack: don't regenerate MIDX unless neededPatrick Steinhardt, Dec 8, 2025
  7. Taylor BlauDec 10, 2025
  8. Patrick SteinhardtDec 10, 2025
  9. 0/3 builtin/repack: avoid rewriting up-to-date MIDXPatrick Steinhardt, Dec 10, 2025
  10. 1/3 midx: fix `BUG()` when getting preferred pack without a reverse indexPatrick Steinhardt, Dec 10, 2025
  11. 2/3 midx-write: extract function to test whether MIDX needs updatingPatrick Steinhardt, Dec 10, 2025
  12. 3/3 midx-write: skip rewriting MIDX with `--stdin-packs` unless neededPatrick Steinhardt, Dec 10, 2025
  13. Junio C HamanoDec 11, 2025
  14. Patrick SteinhardtDec 12, 2025
  15. Taylor BlauDec 18, 2025
  16. Patrick SteinhardtDec 19, 2025

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.