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

From: Taylor Blau <[email-masked]>
Date: Thu, 18 Dec 2025 16:18:48 -0500

On Fri, Dec 12, 2025 at 08:33:14AM +0100, Patrick Steinhardt wrote:
> On Thu, Dec 11, 2025 at 05:46:13PM +0900, Junio C Hamano wrote:
> > 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!

Thanks, both. The new version of these patches looks good to me. FYI I
am going out of office beginning tomorrow through the end of the year.
In case it's easier to queue, it's fine to drop my 3.2 patches from
'seen' and take Patrick's v2 as-is.

I plan on sending a new round of 3.2 in the first week of the new year
and don't mind it being dropped in the meantime, especially if it makes
things easier for the maintainer.

Enjoy the holidays everyone!

Thanks,
Taylor