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

Re: [PATCH 4/5] builtin/multi-pack-index: simplify how common options are wired up

From
Justin Tobler <jltobler@gmail.com>
Date
Dec 1, 2026, 17:13 UTC
Message-ID
<aw7_6efAzLClbLMY@denethor>
In-Reply-To
<aw6oWC_yENDJjd3h@pks.im>
On 26/12/01 11:58AM, Patrick Steinhardt wrote:
Show 24 quoted lines
> On Mon, Nov 30, 2026 at 03:55:00PM -0600, Justin Tobler wrote:
> > @@ -154,8 +147,7 @@ static int cmd_multi_pack_index_write(int argc, const char **argv,
> >  				      const char *prefix,
> >  				      struct repository *repo)
> >  {
> > -	struct option *options;
> > -	static struct option builtin_multi_pack_index_write_options[] = {
> > +	static struct option options[] = {
> >  		OPT_STRING(0, "preferred-pack", &opts.preferred_pack,
> >  			   N_("preferred-pack"),
> >  			   N_("pack for reuse when computing a multi-pack bitmap")),
> > @@ -172,6 +164,7 @@ static int cmd_multi_pack_index_write(int argc, const char **argv,
> >  			 N_("write multi-pack index containing only given indexes")),
> >  		OPT_FILENAME(0, "refs-snapshot", &opts.refs_snapshot,
> >  			     N_("refs snapshot for selecting bitmap commits")),
> > +		MULTI_PACK_INDEX_COMMON_OPTIONS(&opts),
> >  		OPT_END(),
> >  	};
> >  	struct odb_source_packed *packed_source;
> 
> I think this causes a slight change in that the common opitons are now
> at the end of these options, whereas they have been at the beginning
> beforehand. Doesn't really matter much, but it can also easily be
> avoided by adding the common options first.

Good catch. I'll move the common options to the front in the next version.

-Justin
Previous: Patrick SteinhardtNext: Justin Tobler
Message 13 of 25 in “builtin/multi-pack-index: remove global state”
  1. 0/5 builtin/multi-pack-index: remove global stateJustin Tobler, Nov 30, 2026
  2. 1/5 builtin/multi-pack-index: resolve default object directory lazilyJustin Tobler, Nov 30, 2026
  3. Patrick SteinhardtDec 1, 2026
  4. Justin ToblerDec 1, 2026
  5. 2/5 builtin/multi-pack-index: get rid of `the_repository`Justin Tobler, Nov 30, 2026
  6. Patrick SteinhardtDec 1, 2026
  7. Justin ToblerDec 1, 2026
  8. 3/5 builtin/multi-pack-index: drop top-level optionsJustin Tobler, Nov 30, 2026
  9. Patrick SteinhardtDec 1, 2026
  10. Justin ToblerDec 1, 2026
  11. 4/5 builtin/multi-pack-index: simplify how common options are wired upJustin Tobler, Nov 30, 2026
  12. Patrick SteinhardtDec 1, 2026
  13. Justin ToblerDec 1, 2026
  14. 5/5 builtin/multi-pack-index: de-globalize options handlingJustin Tobler, Nov 30, 2026
  15. Patrick SteinhardtDec 1, 2026
  16. Justin ToblerDec 1, 2026
  17. 0/5 builtin/multi-pack-index: remove global stateJustin Tobler, Dec 1, 2026
  18. 1/5 builtin/multi-pack-index: resolve default object directory lazilyJustin Tobler, Dec 1, 2026
  19. Patrick SteinhardtDec 2, 2026
  20. 2/5 builtin/multi-pack-index: get rid of `the_repository`Justin Tobler, Dec 1, 2026
  21. 3/5 builtin/multi-pack-index: drop top-level optionsJustin Tobler, Dec 1, 2026
  22. 4/5 builtin/multi-pack-index: simplify how common options are wired upJustin Tobler, Dec 1, 2026
  23. 5/5 builtin/multi-pack-index: de-globalize options handlingJustin Tobler, Dec 1, 2026
  24. Patrick SteinhardtDec 2, 2026
  25. Patrick SteinhardtDec 2, 2026

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.