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

Re: [PATCH] remote-curl: simplify passing of push specs

From
Junio C Hamano <gitster@pobox.com>
Date
Jul 16, 2026, 14:28 UTC
Message-ID
<xmqqpl0nhutx.fsf@gitster.g>
In-Reply-To
<alhr2bb0lUTHtvjO@pks.im>
Patrick Steinhardt <ps@pks.im> writes:
Show 10 quoted lines
> On Wed, Jul 15, 2026 at 05:39:51PM +0200, René Scharfe wrote:
>> > 
>> We could add one.  Not sure it would make a measurable difference; if
>> the number of specs is huge there are probably other costs that dwarf
>> pushing them to a strvec.
>
> Yeah, I don't expect it to make a difference here, either. But by having
> it we could use it in more places going forward, and that might lead to
> tiny savings here and there that ultimately add up. So it'd be nudging
> folks to "do the right thing".
That's a sensible thought.
Show 9 quoted lines
>> I have to admit that the simplicity of strvec_pushv() nudged me towards
>> using a NULL-terminated array here, though.  So just having a
>> strvec_pushvec() available could guide towards using the length-limited
>> strvec instead of a simpler NULL-terminated array (which explodes if
>> left unterminated).
>
> And that's not a huge issue by itself. I think the version you have here
> is totally fine, and I won't insist on a reroll. But I think it gives us
> a good opportunity to improve the status quo, if we want to take it.

Yeah, strvec_pushvec() might be a worthwhile thing to do, but that can come independent of this topic. The output from:

    $ git grep -n -e strvec_pushv\(

is easy enough to look through to find which callers pass a strvec as the second parameter. It should be quite straightforward to find conversion candidates once the helper is actually implemented. It might even be possible to use Coccinelle for such a conversion.

Previous: Patrick Steinhardt
Message 5 of 5 in “remote-curl: simplify passing of push specs”
  1. remote-curl: simplify passing of push specsRené Scharfe, Jul 15, 2026
  2. Patrick SteinhardtJul 15, 2026
  3. René ScharfeJul 15, 2026
  4. Patrick SteinhardtJul 16, 2026
  5. Junio C HamanoJul 16, 2026

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.