diff options
author | Jonathan Corbet <corbet@lwn.net> | 2008-11-13 09:13:25 -0700 |
---|---|---|
committer | Jonathan Corbet <corbet@lwn.net> | 2008-11-13 09:13:25 -0700 |
commit | f3fd6b568307871bb7213d32412afce8e6f479e2 (patch) | |
tree | d3392c5f05728f932bc4d405e14813488b0926f4 | |
parent | 9a2ba8a4f5e995011e4156dc340e6f8719472234 (diff) |
Better email address handling
Some people quote their names in various tags:
Something-done-by: "J Random Hacker" <...>
We kept the quotes with the name, confusing things down the road. So
change the patterns to exclude those quotes when they exist.
-rw-r--r-- | patterns.py | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/patterns.py b/patterns.py index 9a92cf0..4f878d0 100644 --- a/patterns.py +++ b/patterns.py @@ -16,19 +16,20 @@ import re # expressions." Now they have two problems. # -- Jamie Zawinski # +Pemail = r'\s+"?([^<"]+)"?\s<([^>]+)>' # just email addr + name Pcommit = re.compile (r'^commit ([0-9a-f ]+)$') -Pauthor = re.compile (r'^Author: ([^<]+)\s<([^>]+)>$') -Psob = re.compile (r'Signed-off-by:\s+([^<]+)\s+<([^>]+)>') +Pauthor = re.compile (r'^Author:' + Pemail + '$') +Psob = re.compile (r'Signed-off-by:' + Pemail) Pmerge = re.compile (r'^Merge:.*$') Padd = re.compile (r'^\+[^\+].*$') Prem = re.compile (r'^-[^-].*$') Pdate = re.compile (r'^(Commit)?Date:\s+(.*)$') Pfilea = re.compile (r'^---\s+(.*)$') Pfileb = re.compile (r'^\+\+\+\s+(.*)$') -Preview = re.compile (r'Reviewed-by:\s+([^<]+)\s+<([^>]+)>') -Ptest = re.compile (r' tested-by:\s+([^<]+)\s+<([^>]+)>', re.I) -Prep = re.compile (r'Reported-by:\s+([^<]+)\s+<([^>]+)>') -Preptest = re.compile (r'reported-and-tested-by:\s+([^<]+)\s+<([^>]+)>', re.I) +Preview = re.compile (r'Reviewed-by:' + Pemail) +Ptest = re.compile (r' tested-by:' + Pemail, re.I) +Prep = re.compile (r'Reported-by:' + Pemail) +Preptest = re.compile (r'reported-and-tested-by:' + Pemail, re.I) # # Merges are described with a variety of lines. # |