]> xenbits.xensource.com Git - people/larsk/xenproject-org-gitdm.git/commitdiff
Better email address handling
authorJonathan Corbet <corbet@lwn.net>
Thu, 13 Nov 2008 16:13:25 +0000 (09:13 -0700)
committerJonathan Corbet <corbet@lwn.net>
Thu, 13 Nov 2008 16:13:25 +0000 (09:13 -0700)
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.

patterns.py

index 9a92cf08294f2dc62513d4b9511048b706b20c33..4f878d0862dea7f7253234d9947cf6fbe0dde490 100644 (file)
@@ -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.
 #