Re: [PATCH 1/3] Add git-send-email-script - tool to send emails from git-format-patch-script

2 messages, 2 authors, 2016-06-15 · open the first message on its own page

Re: [PATCH 1/3] Add git-send-email-script - tool to send emails from git-format-patch-script

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:42:03

Ryan Anderson [off-list ref] writes:
If I hope that nobody has done something like:
	GIT_AUTHOR="Ryan <> Anderson"
	GIT_AUTHOR_EMAIL="ryan@michonline.com"

I get more confusing results.
The function git_author_info() would remove <> from the above
GIT_AUTHOR_* environment values by calling ident.c:copy(), so I
think you would get more-or-less what you _should_ expect without
getting confused.

    $ GIT_AUTHOR_NAME="Ryan <> Anderson" \
      GIT_AUTHOR_EMAIL="ryan@michonline.com" git-var -l
    GIT_COMMITTER_IDENT=Junio C Hamano [off-list ref] 1122855849 -0700
    GIT_AUTHOR_IDENT=Ryan  Anderson [off-list ref] 1122855849 -0700
quoted
Is this the culprit that produced this mechanical-looking line?

    To: junkio@cox.net,git@vger.kernel.org
No, that line was exactly what I put into the readline entry.
I was mostly talking about Email::Valid seeming to be stripping
out the display-name[*] part and keeping only addr-spec[*] part,
like this:

    $ cat j.perl
    #!/usr/bin/perl
    use Email::Valid;
    for ('Junio C Hamano [off-list ref]',
         'Ryan Anderson [off-list ref]') {
        print $_, " => ", lc(Email::Valid->address($_)), "\n";
    }
    $ perl j.perl
    Junio C Hamano [off-list ref] => junkio@cox.net
    Ryan Anderson [off-list ref] => ryan@michonline.com

Also, I wonder if running lc() to downcase the local-part[*] is
safe/allowed/correct; domain[*] part is case insensitive and
should be OK to downcase, though.
..., because of the way I pull in all the relevant emails
from various places.  So I really needed a way to cull the duplicates.
...  I could do soemthing like this, instead, I suppose:
I understand your needs, and you can make it a "sub
filter_dups", which I think would make things a lot more
pleasant to read.


[Footnote]

Terms marked [*] are from RFC2822, section 3.4.

Re: [PATCH 1/3] Add git-send-email-script - tool to send emails from git-format-patch-script

From: Matthias Urlichs <hidden>
Date: 2016-06-15 22:42:03

Hi, Junio C Hamano wrote:
Also, I wonder if running lc() to downcase the local-part[*] is
safe/allowed/correct
mostly/no/no.

It's unlikely to be a real-life problem, but we still shouldn't do it.

-- 
Matthias Urlichs   |   {M:U} IT Design @ m-u-it.de   |  smurf@smurf.noris.de
Disclaimer: The quote was selected randomly. Really. | http://smurf.noris.de
 - -
Amusements to virtue are like breezes of air to the flame -- gentle ones will
fan it, but strong ones will put it out.
					-- David Thomas
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help