public inbox for git@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1 0/2] avoid unnecessary strbuf_split*() and strbuf-by-value usage
@ 2026-03-08 18:03 Deveshi Dwivedi
  2026-03-08 18:03 ` [PATCH v1 1/2] worktree: do not pass strbuf by value Deveshi Dwivedi
  2026-03-08 18:03 ` [PATCH v1 2/2] list-objects-filter-options: avoid strbuf_split_str() Deveshi Dwivedi
  0 siblings, 2 replies; 8+ messages in thread
From: Deveshi Dwivedi @ 2026-03-08 18:03 UTC (permalink / raw)
  To: git; +Cc: gitster, peff, Deveshi Dwivedi

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


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2026-03-09 19:26 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-08 18:03 [PATCH v1 0/2] avoid unnecessary strbuf_split*() and strbuf-by-value usage Deveshi Dwivedi
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox