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
Junio C Hamano <gitster@pobox.com>
Date
Mar 11, 2026, 18:13 UTC
Message-ID
<xmqqjyvip73i.fsf@gitster.g>
In-Reply-To
<20260311174816.GB1900488@coredump.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 20 quoted lines
> On Wed, Mar 11, 2026 at 05:33:36PM +0000, Deveshi Dwivedi wrote:
>
>> +	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
Thanks, both.  Will queue.
Previous: Jeff King
Message 11 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.