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

Re: body-CC-comment regression

From
Matthieu Moy <matthieu.moy@grenoble-inp.fr>
Date
Feb 17, 2017, 13:16 UTC
Message-ID
<vpq7f4pdkjp.fsf@anie.imag.fr>
In-Reply-To
<20170217110642.GD2625@localhost>
Johan Hovold <johan@kernel.org> writes:
Show 5 quoted lines
> There is another option, namely to only accept a single address for tags
> in the body. I understand that being able to copy a CC-header to either
> the header section or to the command line could be useful, but I don't
> really see the point in allowing this in the tags in the body (a SoB
> always has one address, and so should a CC-tag).
I mostly agree for the SoB, but why should a Cc tag have only one email?

The "multiple emails per Cc: field" has been there for a while already (b1c8a11c8024 released in 2.6.0, sept 2015), some users may have got used to it. What you are proposing breaks their flow.

> And since this is a regression for something that has been working for
> years that was introduced by a new feature, I also think it's reasonable
> to (partially) revert the feature.

I'd find it rather ironic to fix your case by breaking a feature that has been working for more than a year :-(. What would you answer to a contributor comming one year from now and proposing to revert your reversion because it breaks his flow?

All that said, I think another fix would be both satisfactory for everyone and rather simple:

1) Stop calling Mail::Address even if available. It used to make sense
   to do that when our in-house parser was really poor, but we now have
   something essentially as good as Mail::Address. We test our parser
   against Mail::Address and we do have a few known differences (see
   t9000), but they are really corner-cases and shouldn't matter.
   A good consequence of this is that we stop depending on the way Perl
   is installed to parse emails. Regardless of the current issue, I
   think it is a good thing.
2) Modify our in-house parser to discard garbage after the >. The patch
   should look like (untested):
--- a/perl/Git.pm
+++ b/perl/Git.pm
@@ -903,11 +903,11 @@ sub parse_mailboxes {
        my (@addr_list, @phrase, @address, @comment, @buffer) = ();
        foreach my $token (@tokens) {
                if ($token =~ /^[,;]$/) {
-                       # if buffer still contains undeterminated strings
-                       # append it at the end of @address or @phrase
-                       if ($end_of_addr_seen) {
-                               push @phrase, @buffer;
-                       } else {
+                       # if buffer still contains undeterminated
+                       # strings append it at the end of @address,
+                       # unless we already saw the closing >, in
+                       # which case we discard it.
+                       if (!$end_of_addr_seen) {
                                push @address, @buffer;
                        }
 
What do you think?
-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/
Previous: Johan HovoldNext: Johan Hovold
Message 6 of 22 in “body-CC-comment regression”
  1. Johan HovoldFeb 16, 2017
  2. Junio C HamanoFeb 16, 2017
  3. Johan HovoldFeb 16, 2017
  4. Matthieu MoyFeb 16, 2017
  5. Johan HovoldFeb 17, 2017
  6. Matthieu MoyFeb 17, 2017
  7. Johan HovoldFeb 17, 2017
  8. Matthieu MoyFeb 17, 2017
  9. Johan HovoldFeb 17, 2017
  10. Junio C HamanoFeb 17, 2017
  11. Johan HovoldFeb 17, 2017
  12. Junio C HamanoFeb 17, 2017
  13. Matthieu MoyFeb 17, 2017
  14. Junio C HamanoFeb 17, 2017
  15. Matthieu MoyFeb 17, 2017
  16. Junio C HamanoFeb 17, 2017
  17. Junio C HamanoFeb 17, 2017
  18. send-email: only allow one address per body tagJohan Hovold, Feb 20, 2017
  19. Matthieu MoyFeb 20, 2017
  20. Junio C HamanoFeb 23, 2017
  21. Matthieu MoyFeb 26, 2017
  22. Linus TorvaldsFeb 17, 2017

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.