public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox•com>
To: Taylor Blau <me@ttaylorr•com>
Cc: "René Scharfe" <l.s.r@web•de>, "Git List" <git@vger•kernel.org>,
	"John Cai" <johncai86@gmail•com>
Subject: Re: [PATCH] reflog: fix expire --single-worktree
Date: Tue, 31 Oct 2023 08:24:53 +0900	[thread overview]
Message-ID: <xmqqa5rzbsmy.fsf@gitster.g> (raw)
In-Reply-To: <ZT/mN9RouiqzL9aT@nand.local> (Taylor Blau's message of "Mon, 30 Oct 2023 13:21:59 -0400")

Taylor Blau <me@ttaylorr•com> writes:

> This makes sense to me, but obviously won't catch non-tested cases.

True, but I think we can practically ignore non-tested cases.

The parse_options_check() is used to validate the whole options[]
array that is passed to parse_options() family of API functions, and
its validation is not limited to the options that are given from the
command line in an invocation.  A non-tested case would happen when
a developer prepares and populates "struct option options[];" array
for a (possibly new) git subcommand *and* never uses that array to
call parse_options() in their implementation of that subcommand.
The compiler would catch the unused variable options[] in such a
case, and mark 1 eyeball would notice that none of the options
defined in that array are actually understood by the command, no?

      reply	other threads:[~2023-10-30 23:24 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-28 11:58 [PATCH] reflog: fix expire --single-worktree René Scharfe
2023-10-29 22:31 ` Junio C Hamano
2023-10-30 16:12   ` René Scharfe
2023-10-30 23:11     ` Junio C Hamano
2023-10-31  6:16       ` René Scharfe
2023-10-30 17:21   ` Taylor Blau
2023-10-30 23:24     ` Junio C Hamano [this message]

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=xmqqa5rzbsmy.fsf@gitster.g \
    --to=gitster@pobox$(echo .)com \
    --cc=git@vger$(echo .)kernel.org \
    --cc=johncai86@gmail$(echo .)com \
    --cc=l.s.r@web$(echo .)de \
    --cc=me@ttaylorr$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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