From: Jeff King Date: Tue, 07 Apr 2026 06:18:37 GMT Subject: Re: [PATCH 12/16] builtin/repack.c: convert `--write-midx` to an `OPT_CALLBACK` Message-ID: <20260407061837.GF714878@coredump.intra.peff.net> In-Reply-To: <56dc6d55974ffe08647d57915d0861181e1d7d41.1774820449.git.me@ttaylorr.com> On Sun, Mar 29, 2026 at 05:41:21PM -0400, Taylor Blau wrote: > diff --git a/repack.h b/repack.h > index 77d24ee45fb..81907fcce7f 100644 > --- a/repack.h > +++ b/repack.h > @@ -134,6 +134,11 @@ void pack_geometry_release(struct pack_geometry *geometry); > > struct tempfile; > > +enum repack_write_midx_mode { > + REPACK_WRITE_MIDX_NONE, > + REPACK_WRITE_MIDX_DEFAULT, > +}; Since the name of the variable did not change, the compiler would not catch any old cases that did: if (write_midx) for us. Which made me wonder if we should set _NONE to 0 explicitly here so that continues to work, in case we missed a spot. But after manually checking each spot that uses the enum (and there are not that many), they have all been faithfully converted. So it's probably not worth trying to preserve that compatibility (and anyway, once we introduce a third mode, it's not clear that such a site would be correct anymore anyway). -Peff