From: René Scharfe Date: Fri, 20 Mar 2026 00:46:21 GMT Subject: Re: [PATCH] use strvec_pushv() to add another strvec Message-ID: <6c16da38-654d-4959-b0d9-3fff3d96d036@web.de> In-Reply-To: On 3/19/26 10:14 PM, Junio C Hamano wrote: > René Scharfe writes: > >> Simplify the code by letting strvec_pushv() add the items of a second >> strvec instead of pushing them one by one. >> >> Signed-off-by: René Scharfe >> --- >> fetch-pack.c | 8 ++------ >> git.c | 3 +-- >> submodule.c | 4 +--- >> 3 files changed, 4 insertions(+), 11 deletions(-) > > Nice. Is this something we can make a coccinelle rule for? > > Something like > > @@ > struct strvec SRC; > struct strvec DST; > size_t I; > @@ > - for (size_t I = 0; I < SRC.nr; I++) > - strvec_push(&DST, SRC.v[I]); > + strvec_pushv(&DST, SRC.v); > > perhaps? We can. Should we? It does find a fourth case from the 18th batch that has landed a few hours ago, at least. Will send as v2. René