git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Jeff King <peff@peff.net>
Cc: git@vger.kernel.org, "SZEDER Gábor" <szeder.dev@gmail.com>
Subject: Re: [PATCH 1/3] pass subcommand "prefix" arguments to parse_options()
Date: Thu, 25 Aug 2022 09:47:05 -0700	[thread overview]
Message-ID: <xmqq8rnc2rue.fsf@gitster.g> (raw)
In-Reply-To: <YwdTJOVo46PrIHMc@coredump.intra.peff.net> (Jeff King's message of "Thu, 25 Aug 2022 06:47:00 -0400")

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.

  reply	other threads:[~2022-08-25 16:49 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-25 10:45 [PATCH 0/3] unused function parameters newly in next Jeff King
2022-08-25 10:47 ` [PATCH 1/3] pass subcommand "prefix" arguments to parse_options() Jeff King
2022-08-25 16:47   ` Junio C Hamano [this message]
2022-08-25 10:51 ` [PATCH 2/3] maintenance: add parse-options boilerplate for subcommands Jeff King
2022-08-25 10:51 ` [PATCH 3/3] remote: run "remote rm" argv through parse_options() Jeff King

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=xmqq8rnc2rue.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=peff@peff.net \
    --cc=szeder.dev@gmail.com \
    /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;
as well as URLs for NNTP newsgroup(s).