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

2015-06-19 Thread Matthieu Moy
Remi Lespinet writes: > Matthieu Moy writes: > >> Cool. Then almost all the work is done to get an automated test. Next >> step would be to add the tests itself in the code. I would do that by >> adding a hidden --selfcheck option to git send-email that would compare >> Mail::Address->parse($str

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

2015-06-18 Thread Remi Lespinet
Matthieu Moy writes: > Cool. Then almost all the work is done to get an automated test. Next > step would be to add the tests itself in the code. I would do that by > adding a hidden --selfcheck option to git send-email that would compare > Mail::Address->parse($string); and split_addrs($string);

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

2015-06-18 Thread Matthieu Moy
Remi Lespinet writes: >> Remi Lespinet writes: >> >> > I've some more tests, maybe I should put them all in this post ? >> >> Yes, please post as much as you have. Ideally, this should be >> automatically tested, but if you don't have time to write the automated >> tests, at least having a tra

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

2015-06-18 Thread Remi Lespinet
> Remi Lespinet writes: > > > I've some more tests, maybe I should put them all in this post ? > > Yes, please post as much as you have. Ideally, this should be > automatically tested, but if you don't have time to write the automated > tests, at least having a track of what you did on the list

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

2015-06-18 Thread Matthieu Moy
Remi Lespinet writes: > I've some more tests, maybe I should put them all in this post ? Yes, please post as much as you have. Ideally, this should be automatically tested, but if you don't have time to write the automated tests, at least having a track of what you did on the list archives can h

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

2015-06-17 Thread Remi Lespinet
> Junio C Hamano 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'

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

2015-06-17 Thread Remi Lespinet
Matthieu Moy writes > > + my $commentrgx=qr/\((?:[^)]*)\)/; > > + my $quotergx=qr/"(?:[^\"\\]|\\.)*"/; > > + my $wordrgx=qr/(?:[^]["\s()<>:;@\\,.]|\\.)+/; > > Spaces around = please. > ... > > + foreach my $token (@tokens) { > > + if ($token =~ /^[,;]$/) { > > Here and below: you'

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

2015-06-17 Thread Junio C Hamano
Remi Lespinet writes: > parse_address_line had not the same behavior whether the user had > Mail::Address or not. Teach parse_address_line to behave like > Mail::Address. Sounds like a fun project ;-) > + my $commentrgx=qr/\((?:[^)]*)\)/; > + my $quotergx=qr/"(?:[^\"\\]|\\.)*"/; > +

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

2015-06-17 Thread Matthieu Moy
Remi Lespinet writes: > --- > git-send-email.perl | 54 > +++-- > 1 file changed, 52 insertions(+), 2 deletions(-) > > diff --git a/git-send-email.perl b/git-send-email.perl > index a0cd7ff..a1f6c18 100755 > --- a/git-send-email.perl > +++ b/git-s

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

2015-06-17 Thread Remi Lespinet
parse_address_line had not the same behavior whether the user had Mail::Address or not. Teach parse_address_line to behave like Mail::Address. When the user input is correct, this implementation behaves exactly like Mail::Address except when there are quotes inside the name: "Jane Do"e In thi