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

[RFC] send-email quote issues

From
Remi Lespinet <remi.lespinet@ensimag.grenoble-inp.fr>
Date
Jun 15, 2015, 11:16 UTC
Message-ID
<330077615.505681.1434367014434.JavaMail.zimbra@ensimag.grenoble-inp.fr>
In-Reply-To
<387683965.505610.1434366660032.JavaMail.zimbra@ensimag.grenoble-inp.fr>
Hi,

I'm currently working on git send-email to allow passing names containing commas. I would like to specify that the comma shouldn't be interpreted as a delimiter when there's quotes around:

  "Jane, Katarina Doe" <jdoe@example.com>

This changes the behavior of the double quote. For example when passing:

  --to='"Jane" Doe <jdoe@example.com>'
to git send-email, the line produced was:
  To: "\"Jane\" Doe" <jdoe@example.com>
With this modification, it would be:
  To: Jane Doe <jdoe@example.com>
    or
  To: "Jane Doe" <jdoe@example.com>

And this will not be possible to use quote in a name anymore. Is this a problem ?

Currently, git send-email contains a function which splits at commas with respect to quotes (parse_address_line introduced by 5012699d9840fe34fe0838ea0d529c2f32f76b82). It is used to parse user input when there's no recipient specified. I would like to use this function to parse --to, --cc and --bcc options, but the execution of this function depends on whether the user has the Perl library Mail::Address or not. This introduce a change in the behaviour:

Output1 represents lines produced with the Mail::Address library Output2 represents lines produced without the Mail::Address library

 1) Simple quote are not interpreted the same way:
   Input : 'Doe, "Jane' <jdoe@example.com>
      Output1 : 'Doe,
                "\" Jane'" <jdoe@example.com>
      Output2 : "'Doe, \"Jane'" <jdoe@example.com>
   Input : 'Jane 'Doe' <jdoe@example.com>
      Output1 : 'Jane 'Doe' <jdoe@example.com>
      Output2 : ERROR
 2) Mail::Address adds a space when using a quote or a backslash in a name
   Input : "Jane Do"e <jdoe@example.com>
      Output1 : "\"Jane Do\" e" <jdoe@example.com>
      Output2 : "\"Jane Do\"e" <jdoe@example.com>
   Input : \Jane Doe <jdoe@example.com>
      Output1 : "\ Jane Doe" <jdoe@example.com>
      Output2 : "\Jane Doe" <jdoe@example.com>
 3) Mail::Address works when quote is not closed
   Input : "Jane Doe <jdoe@example.com>
      Output1 : "\" Jane Doe" <jdoe@example.com>
      Output2 : ERROR
 4) Mail::Address splits the string when there's no comma
   Input : Jane "Doe <jdoe@example.com>"
      Output1 : Jane,
   	"\"Doe" <jdoe@example.com>
      Output2 : "Jane \"Doe" <jdoe@example.com>
The following doesn't work for both:
   Input : "Jane Doe <jdoe@example.com>" <jdoe@example.com>
      Output1 : ERROR
      Output2 : ERROR
Next: Matthieu Moy
Message 1 of 5 in “[RFC] send-email quote issues”
  1. Remi LespinetJun 15, 2015
  2. Matthieu MoyJun 15, 2015
  3. Remi LespinetJun 15, 2015
  4. Matthieu MoyJun 15, 2015
  5. Remi LespinetJun 15, 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.