Re: [PATCH v3 2/7] string-list: align string_list_split() with its _in_place() counterpart
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Aug 2, 2025, 16:34 UTC
- Message-ID
- <xmqq4iupk7i7.fsf@gitster.g>
- In-Reply-To
- <20250802082257.GA3711639@coredump.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 10 quoted lines
> You must know by now that writing "some unknown reason" in a commit > message is the best way to nerd-snipe me. ;) > > It looks like 52acddf36c (string-list: multi-delimiter > `string_list_split_in_place()`, 2023-04-24) modified the in-place > variant, but left the original alone. It was needed for the in-place one > to replace strtok(). Probably the original _should_ have been updated > then too for consistency, but wasn't. The motivation isn't given there, > but I'd assume it was some combination of "didn't think of it", > laziness, and not wanting to update all of the callers.
IOW, it wasn't done for some reason that is still unknown ;-).
> I don't think there's a need to re-roll for this. Mostly I was curious > and thought I'd share my finding on the list.
Thanks. IIRC, the multi-delimiter capability was used only in one unit test or test helper that wanted to split at any whitespace. As it did not look so important, I could have unified them in the other direction to only support a single delimiter (i.e. reverting that commit you found), but I think the end result of this series would give us more ergonomic API that we can apply at more places than before, so I am happy I didn't.