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

[PATCH/RFC v2 5/5] send-email: refactor address list process

From
Remi Lespinet <remi.lespinet@ensimag.grenoble-inp.fr>
Date
Jun 8, 2015, 22:12 UTC
Message-ID
<415871115.284559.1433801531886.JavaMail.zimbra@ensimag.grenoble-inp.fr>
In-Reply-To
<xmqq8ubuavze.fsf@gitster.dls.corp.google.com>
Junio C Hamano <gitster@pobox.com> writes
Show 19 quoted lines
> Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> writes:
> 
> > Remi Lespinet <remi.lespinet@ensimag.grenoble-inp.fr> writes:
> >
> >> Simplify code by creating a function to transform list of email lists
> >> (comma separated, with aliases ...)  into a simple list of valid email
> >> addresses.
> >
> > I would have found the series easier to read if this refactoring came
> > earlier (and then PATCH 2/5 would fix the bug as a positive side effect
> > of the refactoring).
> 
> I agree that doing 5/5 sooner would make 4/5 a lot clearer.  
> 
> Introducing the helper of 5/5 before 2/5 happens, and then replacing
> two calls to validate-address-list with process-address-list would
> hide the nature of the change, i.e. fixing a bug, so it is better to
> see it done before the refactoring of 5/5, provided if it is indeed
> a bug that these were not expanded.

Ok thanks, I submit it again soon. Also I think we should swap the lines 'sanitize_address_list(...)' and 'expand_aliases(...)', i.e. first sanitize addresses and then expand aliases.

We could then remove leading and trailing whitespaces in the sanitize_address_list function as aliases file formats supported by git send-email doesn't take these whitespace into account anyway:

Example which currently can't work:
git send-email --to=" alias" ...
Moreover I think it's more natural to do that so.

I'll do it right after the refactoring patch introducing process_address_list or maybe I should avoid changing this patch now ?

Previous: Junio C Hamano
Message 11 of 11 in “t9001-send-email: move script creation in a setup test”
  1. 1/5 t9001-send-email: move script creation in a setup testRemi Lespinet, Jun 6, 2015
  2. 2/5 send-email: allow aliases in patch header and command script outputsRemi Lespinet, Jun 6, 2015
  3. 3/5 t9001-send-email: refactor header variable fields replacementRemi Lespinet, Jun 6, 2015
  4. 4/5 send-email: allow multiple emails using --cc, --to and --bccRemi Lespinet, Jun 6, 2015
  5. 5/5 send-email: refactor address list processRemi Lespinet, Jun 6, 2015
  6. Matthieu MoyJun 8, 2015
  7. 5/5 send-email: refactor address list processRemi Lespinet, Jun 8, 2015
  8. Matthieu MoyJun 8, 2015
  9. 5/5 send-email: refactor address list processRemi Lespinet, Jun 8, 2015
  10. Junio C HamanoJun 8, 2015
  11. 5/5 send-email: refactor address list processRemi Lespinet, Jun 8, 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.