Re: [PATCH v2 4/8] builtin/pack-objects.c: respect 'pack.writeReverseIndex'
- From
Jeff King <peff@peff.net>
- Date
- Jan 22, 2021, 23:57 UTC
- Message-ID
- <YAtmb7wXQse76kJi@coredump.intra.peff.net>
- In-Reply-To
- <68bde3ea972f5b3753d7e9063d0490c67c74709b.1610576805.git.me@ttaylorr.com>
On Wed, Jan 13, 2021 at 05:28:19PM -0500, Taylor Blau wrote:
Show 15 quoted lines
> diff --git a/builtin/pack-objects.c b/builtin/pack-objects.c
> index 5b0c4489e2..d784569200 100644
> --- a/builtin/pack-objects.c
> +++ b/builtin/pack-objects.c
> @@ -2955,6 +2955,13 @@ static int git_pack_config(const char *k, const char *v, void *cb)
> pack_idx_opts.version);
> return 0;
> }
> + if (!strcmp(k, "pack.writereverseindex")) {
> + if (git_config_bool(k, v))
> + pack_idx_opts.flags |= WRITE_REV;
> + else
> + pack_idx_opts.flags &= ~WRITE_REV;
> + return 0;
> + }This turned out delightfully simple. And I guess this is the "why is WRITE_REV" caller I asked about from patch 2. It is finish_tmp_packfile() where the magic happens. That unconditionally calls write_rev_file(), but it's a noop if WRITE_REV isn't specified.
Makes sense.
-Peff