Git development
 help / color / mirror / Atom feed
From: Justin Tobler <jltobler@gmail.com>
To: Patrick Steinhardt <ps@pks.im>
Cc: git@vger.kernel.org
Subject: Re: [PATCH 5/5] builtin/multi-pack-index: de-globalize options handling
Date: Tue, 1 Dec 2026 11:18:45 -0600	[thread overview]
Message-ID: <aw8A3FPmNwUvMoMC@denethor> (raw)
In-Reply-To: <aw6onR6DqUkKJmzY@pks.im>

On 26/12/01 11:59AM, Patrick Steinhardt wrote:
> On Mon, Nov 30, 2026 at 03:55:01PM -0600, Justin Tobler wrote:
> > diff --git a/builtin/multi-pack-index.c b/builtin/multi-pack-index.c
> > index d3881aee6a11..eb5c77456b33 100644
> > --- a/builtin/multi-pack-index.c
> > +++ b/builtin/multi-pack-index.c
> > @@ -214,6 +216,7 @@ static int cmd_multi_pack_index_write(int argc, const char **argv,
> >  
> >  		string_list_clear(&packs, 0);
> >  		free(opts.refs_snapshot);
> > +		free(opts.object_dir);
> >  
> >  		return ret;
> >  
> > @@ -223,6 +226,7 @@ static int cmd_multi_pack_index_write(int argc, const char **argv,
> >  			      opts.refs_snapshot, opts.flags);
> >  
> >  	free(opts.refs_snapshot);
> > +	free(opts.object_dir);
> >  	return ret;
> >  }
> 
> Okay. Now that the options aren't global anymore we of course have to
> free everything they reference. It would have been nice though to unify
> the logic a bit, either by introducing a common return path or by
> introducing a function that releases the memory held on to by `opts`. Or
> both.

With the changes suggested for patch 1, "--object-dir=" no longer needs
to be allocated, and consuently no longer needs to be freed. I'll leave
the existing handling of `refs_snapshot` as-is for now.

Thanks for the review,
-Justin

  reply	other threads:[~2026-12-01 17:18 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-30 21:54 [PATCH 0/5] builtin/multi-pack-index: remove global state Justin Tobler
2026-11-30 21:54 ` [PATCH 1/5] builtin/multi-pack-index: resolve default object directory lazily Justin Tobler
2026-12-01 10:58   ` Patrick Steinhardt
2026-12-01 16:39     ` Justin Tobler
2026-11-30 21:54 ` [PATCH 2/5] builtin/multi-pack-index: get rid of `the_repository` Justin Tobler
2026-12-01 10:58   ` Patrick Steinhardt
2026-12-01 16:46     ` Justin Tobler
2026-11-30 21:54 ` [PATCH 3/5] builtin/multi-pack-index: drop top-level options Justin Tobler
2026-12-01 10:58   ` Patrick Steinhardt
2026-12-01 17:11     ` Justin Tobler
2026-11-30 21:55 ` [PATCH 4/5] builtin/multi-pack-index: simplify how common options are wired up Justin Tobler
2026-12-01 10:58   ` Patrick Steinhardt
2026-12-01 17:13     ` Justin Tobler
2026-11-30 21:55 ` [PATCH 5/5] builtin/multi-pack-index: de-globalize options handling Justin Tobler
2026-12-01 10:59   ` Patrick Steinhardt
2026-12-01 17:18     ` Justin Tobler [this message]
2026-12-01 18:16 ` [PATCH v2 0/5] builtin/multi-pack-index: remove global state Justin Tobler
2026-12-01 18:16   ` [PATCH v2 1/5] builtin/multi-pack-index: resolve default object directory lazily Justin Tobler
2026-12-01 18:16   ` [PATCH v2 2/5] builtin/multi-pack-index: get rid of `the_repository` Justin Tobler
2026-12-01 18:16   ` [PATCH v2 3/5] builtin/multi-pack-index: drop top-level options Justin Tobler
2026-12-01 18:16   ` [PATCH v2 4/5] builtin/multi-pack-index: simplify how common options are wired up Justin Tobler
2026-12-01 18:16   ` [PATCH v2 5/5] builtin/multi-pack-index: de-globalize options handling Justin Tobler

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aw8A3FPmNwUvMoMC@denethor \
    --to=jltobler@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=ps@pks.im \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox