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

Re: [PATCH v3 7/7] send-email: suppress leading and trailing whitespaces before alias expansion

From
Junio C Hamano <gitster@pobox.com>
Date
Jun 10, 2015, 16:15 UTC
Message-ID
<xmqqfv5zmtf0.fsf@gitster.dls.corp.google.com>
In-Reply-To
<vpqoaknr39r.fsf@anie.imag.fr>
Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> writes:
Show 16 quoted lines
> Junio C Hamano <gitster@pobox.com> writes:
>
>> Remi Lespinet <remi.lespinet@ensimag.grenoble-inp.fr> writes:
>>
>>> I agree, I'd like to put it right after split_at_commas in a separate
>>> function "trim_list". Is it a good idea even if the function is one
>>> line long ?
>>
>> Hmph, if I have "A, B, C" and call a function that gives an array of
>> addresses, treating the input as comma-separated addresses, I would
>> expect ("A", "B", "C") to be returned from that function, instead of
>> having to later trim the whitespace around what is returned.
>
> It is actually doing this. But if you have " A,B,C  ", then you'll get
> " A", "B", "C  ". But once you're trimming around commas, trimming
> leading and trailing spaces fits well with split itself.

I guess we are saying the same thing, then? That is, trim-list as a separate step does not make sense an it is part of the job for the helper to turn a single list with multiple addresses into an array?

Previous: Remi LespinetNext: Matthieu Moy
Message 8 of 11 in “send-email: suppress leading and trailing whitespaces in addresses”
  1. 6/7 send-email: suppress leading and trailing whitespaces in addressesRemi Lespinet, Jun 9, 2015
  2. 7/7 send-email: suppress leading and trailing whitespaces before alias expansionRemi Lespinet, Jun 9, 2015
  3. Matthieu MoyJun 10, 2015
  4. 7/7 send-email: suppress leading and trailing whitespaces before alias expansionRemi Lespinet, Jun 10, 2015
  5. Junio C HamanoJun 10, 2015
  6. Matthieu MoyJun 10, 2015
  7. 7/7 send-email: suppress leading and trailing whitespaces before alias expansionRemi Lespinet, Jun 10, 2015
  8. Junio C HamanoJun 10, 2015
  9. Matthieu MoyJun 10, 2015
  10. Matthieu MoyJun 10, 2015
  11. 6/7 send-email: suppress leading and trailing whitespaces in addressesRemi Lespinet, Jun 10, 2015

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.