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

Re: [PATCH 1/3] pass subcommand "prefix" arguments to parse_options()

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 25, 2022, 16:47 UTC
Message-ID
<xmqq8rnc2rue.fsf@gitster.g>
In-Reply-To
<YwdTJOVo46PrIHMc@coredump.intra.peff.net>
Jeff King <peff@peff.net> writes:
> However, there is a good use for it: they should pass it to their own
> parse_options() functions, where it may be used to adjust the value of
> any filename options.

Oh, absolutely. Not passing prefix if they use OPT_FILENAME would be a bug.

> I'd emphasize that this wasn't broken by bf0a6b65fc; it has been broken
> all along, because the sub-function never got to see the prefix. It is
> that commit which is actually enabling us to fix it (and which also
> brought attention to the problem because it triggers -Wunused-parameter!)

Yeah. I like that analysis. With the commit, we pass prefix through the callgraph, and now we can fix it ;-)

Thanks.
Previous: Jeff KingNext: Jeff King
Message 3 of 5 in “unused function parameters newly in next”
  1. 0/3 unused function parameters newly in nextJeff King, Aug 25, 2022
  2. 1/3 pass subcommand "prefix" arguments to parse_options()Jeff King, Aug 25, 2022
  3. Junio C HamanoAug 25, 2022
  4. 2/3 maintenance: add parse-options boilerplate for subcommandsJeff King, Aug 25, 2022
  5. 3/3 remote: run "remote rm" argv through parse_options()Jeff King, Aug 25, 2022

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.