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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> Junio C Hamano <gitster@xxxxxxxxx> 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!


> > +                if ($str_address ne "" && $str_phrase ne "") {
> > +                    $str_address = qq[<$str_address>];
> > +                }
> 
> We see both "git@xxxxxxxxxxxxxxx" and "<git@xxxxxxxxxxxxxxx>" around
> here for an address without comment or phrase; this chooses to turn
> them both into "<git@xxxxxxxxxxxxxxx>" 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@xxxxxxxxxxxxxxx" form,
in both cases, because it'll be recognize as an address, $str_address
will be "git@xxxxxxxxxxxxxxx" and $str_phrase will be empty before the
if ($str_address ne "" ...)
Here are some tests:

Input: <jdoe@xxxxxxxxxxx>
Split: jdoe@xxxxxxxxxxx
M::A : jdoe@xxxxxxxxxxx
----------
Input: jdoe@xxxxxxxxxxx
Split: jdoe@xxxxxxxxxxx
M::A : jdoe@xxxxxxxxxxx
----------
Input: Jane <jdoe@xxxxxxxxxxx>
Split: Jane <jdoe@xxxxxxxxxxx>
M::A : Jane <jdoe@xxxxxxxxxxx>
----------
Input: Jane Doe <jdoe@xxxxxxxxxxx>
Split: Jane Doe <jdoe@xxxxxxxxxxx>
M::A : Jane Doe <jdoe@xxxxxxxxxxx>
----------
Input: "Jane" <jdoe@xxxxxxxxxxx>
Split: "Jane" <jdoe@xxxxxxxxxxx>
M::A : "Jane" <jdoe@xxxxxxxxxxx>
----------
Input: "Doe, Jane" <jdoe@xxxxxxxxxxx>
Split: "Doe, Jane" <jdoe@xxxxxxxxxxx>
M::A : "Doe, Jane" <jdoe@xxxxxxxxxxx>

I've some more tests, maybe I should put them all in this post ?
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]