From: Jonathan Corbet Date: Thu, 13 Nov 2008 16:13:25 +0000 (-0700) Subject: Better email address handling X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=f3fd6b568307871bb7213d32412afce8e6f479e2;p=people%2Flarsk%2Fxenproject-org-gitdm.git 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. --- 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. #