Re: [PATCH v3] send-email: extract email-parsing code into a subroutine

2017-12-06 Thread Matthieu Moy
PAYRE NATHAN p1508475 writes: > Without the "print" used for testing. But still smoe broken indentation: > git-send-email.perl | 90 > + > 1 file changed, 63 insertions(+), 27 deletions(-) > > diff --git a/git-send-email.perl b/git-send-ema

Re: [PATCH v3] send-email: extract email-parsing code into a subroutine

2017-12-06 Thread Ævar Arnfjörð Bjarmason
On Thu, Dec 7, 2017 at 12:02 AM, Nathan Payre wrote: > +sub parse_header_line { > + my $lines = shift; > + my $parsed_line = shift; > + > + foreach (split(/\n/, $lines)) { > + if (/^(To|Cc|Bcc):\s*(.+)$/i) { > + $parsed_line->{lc $1} = [ parse

[PATCH v3] send-email: extract email-parsing code into a subroutine

2017-12-06 Thread Nathan Payre
The existing code mixes parsing of email header with regular expression and actual code. Extract the parsing code into a new subroutine 'parse_header_line()'. This improves the code readability and make parse_header_line reusable in other place. Signed-off-by: Nathan Payre Signed-off-by: Matthieu