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

Re: [PATCH] reflog: fix expire --single-worktree

From
Junio C Hamano <gitster@pobox.com>
Date
Oct 30, 2023, 23:24 UTC
Message-ID
<xmqqa5rzbsmy.fsf@gitster.g>
In-Reply-To
<ZT/mN9RouiqzL9aT@nand.local>
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?

Previous: Taylor Blau
Message 7 of 7 in “reflog: fix expire --single-worktree”
  1. reflog: fix expire --single-worktreeRené Scharfe, Oct 28, 2023
  2. Junio C HamanoOct 29, 2023
  3. René ScharfeOct 30, 2023
  4. Junio C HamanoOct 30, 2023
  5. René ScharfeOct 31, 2023
  6. Taylor BlauOct 30, 2023
  7. Junio C HamanoOct 30, 2023

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.