Re: [PATCH v3 4/7] string-list: optionally trim string pieces split by string_list_split*()
- From
Jeff King <peff@peff.net>
- Date
- Aug 2, 2025, 18:39 UTC
- Message-ID
- <20250802183916.GB1773585@coredump.intra.peff.net>
- In-Reply-To
- <xmqqzfchispv.fsf@gitster.g>
On Sat, Aug 02, 2025 at 09:38:52AM -0700, Junio C Hamano wrote:
Show 17 quoted lines
> > It might be worth defining here what "trim" means. I can think of two > > obvious definitions: > > > > 1. trim whitespace from each split piece > > > > 2. trim excess delimiters from each split piece (which in turn depends > > on how we handle multiple delimiters; do we make empty pieces, or > > do we collapse them? I think the former, which would make this type > > of trimming impossible?). > > > > It looks like the patch does (1). > > True. "nm git | grep trim" tells us that we most of the time use > the word to mean removing whitespaces, but there are exceptions. > > It certainly is a good idea to rewrite "trim()" in that comment to > "trim whitespaces around" or something like that.
Yep, ordinarily I'd assume it means whitespace. But since the function takes a different delimiter, a hint of doubt crept into my mind. The text you suggest would have made that go away.
-Peff