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

Re: [PATCH] submodule--helper: use strvec_pushf() for --super-prefix

From
Jeff King <peff@peff.net>
Date
Jul 1, 2024, 03:42 UTC
Message-ID
<20240701034220.GD610406@coredump.intra.peff.net>
In-Reply-To
<fb79ebc4-5ecf-4257-ac2e-39f98db5649c@web.de>
On Sat, Jun 29, 2024 at 08:01:24PM +0200, René Scharfe wrote:
Show 5 quoted lines
> Use the strvec_pushf() call that already appends a slash to also produce
> the stuck form of the option --super-prefix instead of adding the option
> name in a separate call of strvec_push() or strvec_pushl().  This way we
> can more easily see that these parts make up a single option with its
> argument and save a function call.

I agree it's more readable (both the code and any GIT_TRACE output). But also I think the "stuck" form is what we recommend in gitcli(7), since it is future-proof against optional arguments. So we'd also be setting a good example.

-Peff
Previous: René Scharfe
Message 2 of 2 in “submodule--helper: use strvec_pushf() for --super-prefix”
  1. submodule--helper: use strvec_pushf() for --super-prefixRené Scharfe, Jun 29, 2024
  2. Jeff KingJul 1, 2024

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.