From: Junio C Hamano <gitster@pobox.com>
To: Patrick Steinhardt <ps@pks.im>
Cc: "René Scharfe" <l.s.r@web.de>, "Git List" <git@vger.kernel.org>
Subject: Re: [PATCH] remote-curl: simplify passing of push specs
Date: Thu, 16 Jul 2026 07:28:58 -0700 [thread overview]
Message-ID: <xmqqpl0nhutx.fsf@gitster.g> (raw)
In-Reply-To: <alhr2bb0lUTHtvjO@pks.im> (Patrick Steinhardt's message of "Thu, 16 Jul 2026 07:27:53 +0200")
Patrick Steinhardt <ps@pks.im> writes:
> 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.
>> 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.
prev parent reply other threads:[~2026-07-16 14:29 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-15 4:41 [PATCH] remote-curl: simplify passing of push specs René Scharfe
2026-07-15 6:41 ` Patrick Steinhardt
2026-07-15 15:39 ` René Scharfe
2026-07-16 5:27 ` Patrick Steinhardt
2026-07-16 14:28 ` 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=xmqqpl0nhutx.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=l.s.r@web.de \
--cc=ps@pks.im \
/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