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

Re: [PATCH v3 2/2] list-objects-filter-options: avoid strbuf_split_str()

From
Jeff King <peff@peff.net>
Date
Mar 11, 2026, 17:48 UTC
Message-ID
<20260311174816.GB1900488@coredump.intra.peff.net>
In-Reply-To
<20260311173336.8395-3-deveshigurgaon@gmail.com>
On Wed, Mar 11, 2026 at 05:33:36PM +0000, Deveshi Dwivedi wrote:
Show 14 quoted lines
> +	while (*p && !result) {
> +		const char *end = strchrnul(p, '+');
> +
> +		strbuf_reset(&sub);
> +		strbuf_add(&sub, p, end - p);
> +
> +		if (sub.len)
> +			result = parse_combine_subfilter(filter_options, sub.buf, errbuf);
> +
> +		if (!*end)
> +			break;
> +		p = end + 1;
>  	}
> +	strbuf_release(&sub);
This version of the loop looks good to me.
-Peff
Previous: Deveshi DwivediNext: Junio C Hamano
Message 10 of 11 in “avoid unnecessary strbuf_split*() and strbuf-by-value usage”
  1. 0/2 avoid unnecessary strbuf_split*() and strbuf-by-value usageDeveshi Dwivedi, Mar 11, 2026
  2. 1/2 worktree: do not pass strbuf by valueDeveshi Dwivedi, Mar 11, 2026
  3. 2/2 list-objects-filter-options: avoid strbuf_split_str()Deveshi Dwivedi, Mar 11, 2026
  4. Junio C HamanoMar 11, 2026
  5. Jeff KingMar 11, 2026
  6. Junio C HamanoMar 11, 2026
  7. 0/2 avoid unnecessary strbuf_split*() and strbuf-by-value usageDeveshi Dwivedi, Mar 11, 2026
  8. 1/2 worktree: do not pass strbuf by valueDeveshi Dwivedi, Mar 11, 2026
  9. 2/2 list-objects-filter-options: avoid strbuf_split_str()Deveshi Dwivedi, Mar 11, 2026
  10. Jeff KingMar 11, 2026
  11. Junio C HamanoMar 11, 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.