{"thread":{"id":"39632","subject":"[RFC] send-email quote issues","startedAt":"2015-06-15T11:16:54Z","lastAt":"2015-06-15T14:10:56Z","messageCount":5,"participants":["Remi Lespinet","Matthieu Moy"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"263854","messageId":"330077615.505681.1434367014434.JavaMail.zimbra@ensimag.grenoble-inp.fr","threadId":"39632","inReplyTo":"387683965.505610.1434366660032.JavaMail.zimbra@ensimag.grenoble-inp.fr","subject":"[RFC] send-email quote issues","fromName":"Remi Lespinet","fromEmail":"remi.lespinet@ensimag.grenoble-inp.fr","sentAt":"2015-06-15T11:16:54Z","receivedAt":"2015-06-15T11:16:54Z","isPatch":false,"sender":{"key":"remi.lespinet@ensimag.grenoble-inp.fr","avatar":"https://avatars.githubusercontent.com/u/11941160?v=4"},"body":"Hi,\n\nI'm currently working on git send-email to allow passing names\ncontaining commas. I would like to specify that the comma\nshouldn't be interpreted as a delimiter when there's quotes\naround:\n\n  \"Jane, Katarina Doe\" <jdoe@example.com>\n\nThis changes the behavior of the double quote. For example\nwhen passing:\n\n  --to='\"Jane\" Doe <jdoe@example.com>'\n\nto git send-email, the line produced was:\n\n  To: \"\\\"Jane\\\" Doe\" <jdoe@example.com>\n\nWith this modification, it would be:\n\n  To: Jane Doe <jdoe@example.com>\n    or\n  To: \"Jane Doe\" <jdoe@example.com>\n\nAnd this will not be possible to use quote in a name anymore.\nIs this a problem ?\n\nCurrently, git send-email contains a function which splits at commas\nwith respect to quotes (parse_address_line introduced by\n5012699d9840fe34fe0838ea0d529c2f32f76b82). It is used to parse user\ninput when there's no recipient specified. I would like to use this\nfunction to parse --to, --cc and --bcc options, but the execution of\nthis function depends on whether the user has the Perl library\nMail::Address or not. This introduce a change in the behaviour:\n\nOutput1 represents lines produced with the Mail::Address library\nOutput2 represents lines produced without the Mail::Address library\n\n 1) Simple quote are not interpreted the same way:\n\n   Input : 'Doe, \"Jane' <jdoe@example.com>\n      Output1 : 'Doe,\n                \"\\\" Jane'\" <jdoe@example.com>\n      Output2 : \"'Doe, \\\"Jane'\" <jdoe@example.com>\n\n   Input : 'Jane 'Doe' <jdoe@example.com>\n      Output1 : 'Jane 'Doe' <jdoe@example.com>\n      Output2 : ERROR\n\n 2) Mail::Address adds a space when using a quote or a backslash in a name\n\n   Input : \"Jane Do\"e <jdoe@example.com>\n      Output1 : \"\\\"Jane Do\\\" e\" <jdoe@example.com>\n      Output2 : \"\\\"Jane Do\\\"e\" <jdoe@example.com>\n\n   Input : \\Jane Doe <jdoe@example.com>\n      Output1 : \"\\ Jane Doe\" <jdoe@example.com>\n      Output2 : \"\\Jane Doe\" <jdoe@example.com>\n\n 3) Mail::Address works when quote is not closed\n\n   Input : \"Jane Doe <jdoe@example.com>\n      Output1 : \"\\\" Jane Doe\" <jdoe@example.com>\n      Output2 : ERROR\n\n 4) Mail::Address splits the string when there's no comma\n\n   Input : Jane \"Doe <jdoe@example.com>\"\n      Output1 : Jane,\n   \t\"\\\"Doe\" <jdoe@example.com>\n      Output2 : \"Jane \\\"Doe\" <jdoe@example.com>\n\nThe following doesn't work for both:\n\n   Input : \"Jane Doe <jdoe@example.com>\" <jdoe@example.com>\n      Output1 : ERROR\n      Output2 : ERROR\n"},{"id":"263855","messageId":"vpqmw011a22.fsf@anie.imag.fr","threadId":"39632","inReplyTo":"330077615.505681.1434367014434.JavaMail.zimbra@ensimag.grenoble-inp.fr","subject":"Re: [RFC] send-email quote issues","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@grenoble-inp.fr","sentAt":"2015-06-15T11:32:37Z","receivedAt":"2015-06-15T11:32:37Z","isPatch":false,"sender":{"key":"matthieu.moy@grenoble-inp.fr","avatar":"https://gravatar.com/avatar/72c8a2705971a25dfaff23cece15130d405685845d911aedd5667ace277f3fc5?d=mp&s=160"},"body":"Remi Lespinet <remi.lespinet@ensimag.grenoble-inp.fr> writes:\n\n> Currently, git send-email contains a function which splits at commas\n> with respect to quotes (parse_address_line introduced by\n> 5012699d9840fe34fe0838ea0d529c2f32f76b82).\n\nIt seems I had missed this one, but indeed, it should probably be used\ninstead of split_at_commas in your series.\n\n> It is used to parse user input when there's no recipient specified. I\n> would like to use this function to parse --to, --cc and --bcc options,\n> but the execution of this function depends on whether the user has the\n> Perl library Mail::Address or not. This introduce a change in the\n> behaviour:\n\nI would say that using parse_address_line is good for consistancy in Git\nanyway. If the behavior of parse_address_line is broken on some\ncorner-cases, then it should be fixed anyway.\n\n-- \nMatthieu Moy\nhttp://www-verimag.imag.fr/~moy/\n"},{"id":"263859","messageId":"999870154.509851.1434373434414.JavaMail.zimbra@ensimag.grenoble-inp.fr","threadId":"39632","inReplyTo":"vpqmw011a22.fsf@anie.imag.fr","subject":"[RFC] send-email quote issues","fromName":"Remi Lespinet","fromEmail":"remi.lespinet@ensimag.grenoble-inp.fr","sentAt":"2015-06-15T13:03:54Z","receivedAt":"2015-06-15T13:03:54Z","isPatch":false,"sender":{"key":"remi.lespinet@ensimag.grenoble-inp.fr","avatar":"https://avatars.githubusercontent.com/u/11941160?v=4"},"body":"Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> writes\n\n> I would say that using parse_address_line is good for consistancy in Git \n> anyway. If the behavior of parse_address_line is broken on some \n> corner-cases, then it should be fixed anyway. \n\nOk, but I don't know what fixed means in these particular cases.\nActually the problem when we have a quote in a name is: Is this a\ndelimiter or is this an ascii char?\n\nCurrently the problem is solved by saying : it's an ascii char\nunless there is two quotes aroung all the name (modulo minor\nthings). So if I write:\n\n--to='\"Jane, Kararina\" Doe <jdoe@example.com>'\n\nthey are considered characters. Which means that this is\ndifferent than:\n\n--to='\"Jane, Kararina Doe\" <jdoe@example.com>'\n\nIs this expected?\n"},{"id":"263860","messageId":"vpqd20xxenv.fsf@anie.imag.fr","threadId":"39632","inReplyTo":"999870154.509851.1434373434414.JavaMail.zimbra@ensimag.grenoble-inp.fr","subject":"Re: [RFC] send-email quote issues","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@grenoble-inp.fr","sentAt":"2015-06-15T13:52:04Z","receivedAt":"2015-06-15T13:52:04Z","isPatch":false,"sender":{"key":"matthieu.moy@grenoble-inp.fr","avatar":"https://gravatar.com/avatar/72c8a2705971a25dfaff23cece15130d405685845d911aedd5667ace277f3fc5?d=mp&s=160"},"body":"Remi Lespinet <remi.lespinet@ensimag.grenoble-inp.fr> writes:\n\n> Ok, but I don't know what fixed means in these particular cases.\n> Actually the problem when we have a quote in a name is: Is this a\n> delimiter or is this an ascii char?\n\nTo me, the answer should be: do whatever the RFC says in email headers.\nI'd expect anything that works in the To: header to work in the --to\noption of git send-email.\n\nIf I read correctly, this is address-list in RFC 2822.\n\nNow, when the address list is invalid wrt the RFC, we can either reject\nit or try to guess.\n\n-- \nMatthieu Moy\nhttp://www-verimag.imag.fr/~moy/\n"},{"id":"263862","messageId":"232346536.513056.1434377456905.JavaMail.zimbra@ensimag.grenoble-inp.fr","threadId":"39632","inReplyTo":"vpqd20xxenv.fsf@anie.imag.fr","subject":"[RFC] send-email quote issues","fromName":"Remi Lespinet","fromEmail":"remi.lespinet@ensimag.grenoble-inp.fr","sentAt":"2015-06-15T14:10:56Z","receivedAt":"2015-06-15T14:10:56Z","isPatch":false,"sender":{"key":"remi.lespinet@ensimag.grenoble-inp.fr","avatar":"https://avatars.githubusercontent.com/u/11941160?v=4"},"body":"Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> writes\n\n> To me, the answer should be: do whatever the RFC says in email headers. \n> I'd expect anything that works in the To: header to work in the --to \n> option of git send-email. \n\nOk sounds good to me !\n"}]}