Subject: Re: [PATCH v2 6/7] string-list: optionally omit empty string pieces in string_list_split*()

From: Junio C Hamano <[email-masked]>
Date: Fri, 01 Aug 2025 09:38:17 -0700

Patrick Steinhardt <[email-masked]> writes:

>> +	if ((flags & STRING_LIST_SPLIT_NONEMPTY) && (end <= p))
>> +		return 0;
>
> Okay, this is where the return value of `append_one()` starts to make
> sense.
>
> The condition for `end <= p` is probably overly defensive, as it
> shouldn't ever happen that `end < p`. We could make that a `BUG()`, but
> I'm not sure that's really worth it.

Correct.  I'd leave it to be defensive but without overly
pessimistic BUG, as this is a leaf function that, once carefully
vetted, is unlikely to become buggy (which is famous last words).