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

[PATCH/RFC v4 07/10] send-email: reduce dependancies impact on parse_address_line

From
Remi Lespinet <remi.lespinet@ensimag.grenoble-inp.fr>
Date
Jun 17, 2015, 23:48 UTC
Message-ID
<989982277.592587.1434584914349.JavaMail.zimbra@ensimag.grenoble-inp.fr>
In-Reply-To
<xmqqioam58kz.fsf@gitster.dls.corp.google.com>
Show 5 quoted lines
> Junio C Hamano <gitster@pobox.com> writes
> Suffix "rgx" that means "regular expression" is a bit unusual, and
> also hard to read when squashed to another word.  Elsewhere in the
> same script, we seem to use $re_whatever to store precompiled
> regular expressions, so perhaps $re_comment, $re_quote, etc.?
Yes it's indeed a better name. I had not seen it, thanks!
Show 8 quoted lines
> > +                if ($str_address ne "" && $str_phrase ne "") {
> > +                    $str_address = qq[<$str_address>];
> > +                }
> 
> We see both "git@vger.kernel.org" and "<git@vger.kernel.org>" around
> here for an address without comment or phrase; this chooses to turn
> them both into "<git@vger.kernel.org>" form?  Not a complaint but am
> thinking aloud to see if I am reading it correctly.

If there's no phrase, this will choose the "git@vger.kernel.org" form, in both cases, because it'll be recognize as an address, $str_address will be "git@vger.kernel.org" and $str_phrase will be empty before the if ($str_address ne "" ...) Here are some tests:

Input: <jdoe@example.com>
Split: jdoe@example.com
M::A : jdoe@example.com
----------
Input: jdoe@example.com
Split: jdoe@example.com
M::A : jdoe@example.com
----------
Input: Jane <jdoe@example.com>
Split: Jane <jdoe@example.com>
M::A : Jane <jdoe@example.com>
----------
Input: Jane Doe <jdoe@example.com>
Split: Jane Doe <jdoe@example.com>
M::A : Jane Doe <jdoe@example.com>
----------
Input: "Jane" <jdoe@example.com>
Split: "Jane" <jdoe@example.com>
M::A : "Jane" <jdoe@example.com>
----------
Input: "Doe, Jane" <jdoe@example.com>
Split: "Doe, Jane" <jdoe@example.com>
M::A : "Doe, Jane" <jdoe@example.com>
I've some more tests, maybe I should put them all in this post ?
Previous: Junio C HamanoNext: Matthieu Moy
Message 12 of 50 in “t9001-send-email: move script creation in a setup test”
  1. 01/10 t9001-send-email: move script creation in a setup testRemi Lespinet, Jun 17, 2015
  2. 02/10 send-email: allow aliases in patch header and command script outputsRemi Lespinet, Jun 17, 2015
  3. 03/10 t9001-send-email: refactor header variable fields replacementRemi Lespinet, Jun 17, 2015
  4. 04/10 send-email: refactor address list processRemi Lespinet, Jun 17, 2015
  5. 05/10 send-email: Allow use of aliases in the From field of --compose modeRemi Lespinet, Jun 17, 2015
  6. Matthieu MoyJun 17, 2015
  7. 06/10 send-email: minor code refactoringRemi Lespinet, Jun 17, 2015
  8. 07/10 send-email: reduce dependancies impact on parse_address_lineRemi Lespinet, Jun 17, 2015
  9. Matthieu MoyJun 17, 2015
  10. 07/10 send-email: reduce dependancies impact on parse_address_lineRemi Lespinet, Jun 17, 2015
  11. Junio C HamanoJun 17, 2015
  12. 07/10 send-email: reduce dependancies impact on parse_address_lineRemi Lespinet, Jun 17, 2015
  13. Matthieu MoyJun 18, 2015
  14. 07/10 send-email: reduce dependancies impact on parse_address_lineRemi Lespinet, Jun 18, 2015
  15. Matthieu MoyJun 18, 2015
  16. 07/10 send-email: reduce dependancies impact on parse_address_lineRemi Lespinet, Jun 18, 2015
  17. Matthieu MoyJun 19, 2015
  18. 08/10 send-email: consider quote as delimiter instead of characterRemi Lespinet, Jun 17, 2015
  19. 09/10 send-email: allow multiple emails using --cc, --to and --bccRemi Lespinet, Jun 17, 2015
  20. 10/10 send-email: suppress meaningless whitespaces in from fieldRemi Lespinet, Jun 17, 2015
  21. Matthieu MoyJun 17, 2015
  22. 10/10 send-email: suppress meaningless whitespaces in from fieldRemi Lespinet, Jun 17, 2015
  23. 01/10 t9001-send-email: move script creation in a setup testRemi Lespinet, Jun 20, 2015
  24. 02/10 send-email: allow aliases in patch header and command script outputsRemi Lespinet, Jun 20, 2015
  25. 03/10 t9001-send-email: refactor header variable fields replacementRemi Lespinet, Jun 20, 2015
  26. 04/10 send-email: refactor address list processRemi Lespinet, Jun 20, 2015
  27. 05/10 send-email: Allow use of aliases in the From field of --compose modeRemi Lespinet, Jun 20, 2015
  28. 06/10 send-email: minor code refactoringRemi Lespinet, Jun 20, 2015
  29. 07/10 send-email: reduce dependancies impact on parse_address_lineRemi Lespinet, Jun 20, 2015
  30. Matthieu MoyJun 21, 2015
  31. 07/10 send-email: reduce dependancies impact on parse_address_lineRemi Lespinet, Jun 21, 2015
  32. 07/10 send-email: reduce dependancies impact on parse_address_lineRemi Lespinet, Jun 23, 2015
  33. Matthieu MoyJun 21, 2015
  34. 08/10 send-email: consider quote as delimiter instead of characterRemi Lespinet, Jun 21, 2015
  35. 09/10 send-email: allow multiple emails using --cc, --to and --bccRemi Lespinet, Jun 21, 2015
  36. Matthieu MoyJun 21, 2015
  37. 10/10 send-email: suppress meaningless whitespaces in from fieldRemi Lespinet, Jun 21, 2015
  38. 01/10 t9001-send-email: move script creation in a setup testRemi Lespinet, Jun 23, 2015
  39. 02/10 send-email: allow aliases in patch header and command script outputsRemi Lespinet, Jun 23, 2015
  40. 03/10 t9001-send-email: refactor header variable fields replacementRemi Lespinet, Jun 23, 2015
  41. 04/10 send-email: refactor address list processRemi Lespinet, Jun 23, 2015
  42. 05/10 send-email: Allow use of aliases in the From field of --compose modeRemi Lespinet, Jun 23, 2015
  43. 06/10 send-email: minor code refactoringRemi Lespinet, Jun 23, 2015
  44. 07/10 send-email: reduce dependencies impact on parse_address_lineRemi Lespinet, Jun 23, 2015
  45. Matthieu MoyJun 23, 2015
  46. 07/10 send-email: reduce dependencies impact on parse_address_lineRemi LESPINET, Jun 23, 2015
  47. 08/10 send-email: consider quote as delimiter instead of characterRemi Lespinet, Jun 23, 2015
  48. 09/10 send-email: allow multiple emails using --cc, --to and --bccRemi Lespinet, Jun 23, 2015
  49. Matthieu MoyJun 23, 2015
  50. 10/10 send-email: suppress meaningless whitespaces in from fieldRemi Lespinet, Jun 23, 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.