Messages in this thread | | | Date | Wed, 8 Jun 2011 16:24:08 -0400 | From | Nick Bowler <> | Subject | Re: [PATCH] checkpatch: Validate signature styles and To: and Cc: lines |
| |
On 2011-06-08 12:34 -0700, Joe Perches wrote: > Signatures have many forms and can sometimes cause problems > if not in the correct format when using git send-email or quilt. > > Try to verify the signature tags and email addresses to use > the generally accepted "Signed-off-by: Full Name <email@domain.tld>" > form. [...] > + my $suggested_email = format_email(parse_email($email)); > + if ($suggested_email eq "") { > + ERROR("email address '$email' is unrecognizable\n" . $herecurr); > + } elsif ($suggested_email ne $email) { > + WARN("email address '$email' might be better as '$suggested_email'\n" . $herecurr);
If you're going to make suggestions, you should at the very least ensure that the suggestions are actually valid email addresses. Otherwise, this script will suggest replacing valid addresses with invalid ones!
In particular, angle brackets inside "quotes" or (comments) will seriously trip up this script. For example:
WARNING: email address '"Foo Bar <x124>" <fbar@example.org>' might be better as 'Foo Bar <x124>"<fbar@example.org>' #8: Signed-off-by: "Foo Bar <x124>" <fbar@example.org>
Even more amusing is that we can actually follow the bogus suggestion and checkpatch.pl won't complain about the resulting invalid email address (at least it's consistent, I guess):
Signed-off-by: Foo Bar <x124>"<fbar@example.org>
patch has no obvious style problems and is ready for submission.
-- Nick Bowler, Elliptic Technologies (http://www.elliptictech.com/)
| |