From: Deveshi Dwivedi <deveshigurgaon@gmail.com>
To: git@vger.kernel.org
Cc: gitster@pobox.com, peff@peff.net,
Deveshi Dwivedi <deveshigurgaon@gmail.com>
Subject: [PATCH v1 0/2] avoid unnecessary strbuf_split*() and strbuf-by-value usage
Date: Sun, 8 Mar 2026 18:03:57 +0000 [thread overview]
Message-ID: <20260308180359.31188-1-deveshigurgaon@gmail.com> (raw)
Junio's "do not overuse strbuf_split*()" series [1] calls out
remaining uses of strbuf_split*() as leftover bits for others to
continue. This series picks up two of them.
write_worktree_linking_files() takes two struct strbuf parameters by
value even though it only needs plain path strings. This is the same
class of problem fixed for builtin/clean.c in that series.
parse_combine_filter() in list-objects-filter-options.c uses
strbuf_split_str() to split a combine: filter spec at '+', then
mutates each non-final piece to strip the trailing delimiter. An
array of strbufs is unnecessary; the function processes one sub-spec
at a time and does not use strbuf editing on the pieces.
[1]: https://lore.kernel.org/git/20250731225433.4028872-1-gitster@pobox.com/
Deveshi Dwivedi (2):
worktree: do not pass strbuf by value
list-objects-filter-options: avoid strbuf_split_str()
builtin/worktree.c | 2 +-
list-objects-filter-options.c | 40 +++++++++++++++++------------------
worktree.c | 22 +++++++++----------
worktree.h | 2 +-
4 files changed, 33 insertions(+), 33 deletions(-)
--
2.52.0.230.gd8af7cadaa
next reply other threads:[~2026-03-08 18:04 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-08 18:03 Deveshi Dwivedi [this message]
2026-03-08 18:03 ` [PATCH v1 1/2] worktree: do not pass strbuf by value Deveshi Dwivedi
2026-03-09 14:48 ` Junio C Hamano
2026-03-09 19:26 ` coccinelle to catch pass-by-value?, was: " Jeff King
2026-03-08 18:03 ` [PATCH v1 2/2] list-objects-filter-options: avoid strbuf_split_str() Deveshi Dwivedi
2026-03-09 15:38 ` Junio C Hamano
2026-03-09 19:01 ` Jeff King
2026-03-09 19:08 ` Jeff King
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=20260308180359.31188-1-deveshigurgaon@gmail.com \
--to=deveshigurgaon@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=peff@peff.net \
/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