Make tag matching stricter

If you commit a git changelog to your repository, gitdm will be confused by
all the added patch tags.  So make the patterns stricter to force them only
to match within the git log metadata - or so we hope.  There is still room
for confusion here; we really need to make grabpatch() smart enough to
split metadata and the diff.  Don't have time for that now.

This patch changes results slightly.  In the 2.6.36 cycle, there's a tag
reading:

    Original-Idea-and-Signed-off-by: Nicolas Pitre <nicolas.pitre@linaro.org>

Pre-patch gitdm would recognize that as a signoff; after the change it no
longer does.

Reported-by: Wolfgang Denk <wd@denx.de>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
This commit is contained in:
Jonathan Corbet
2010-10-04 17:06:33 -06:00
parent ea23ca50c0
commit f64e9ffbd8
2 changed files with 10 additions and 10 deletions

10
gitdm
View File

@@ -189,7 +189,7 @@ def grabpatch():
#
# Could be a signed-off-by:
#
m = Psob.search (Line)
m = Psob.match (Line)
if m:
email = database.RemapEmail (m.group (2))
sobber = LookupStoreHacker(m.group (1), email)
@@ -199,24 +199,24 @@ def grabpatch():
#
# Various other tags of interest.
#
m = Preview.search (Line) # Reviewed-by:
m = Preview.match (Line) # Reviewed-by:
if m:
email = database.RemapEmail (m.group (2))
p.addreviewer (LookupStoreHacker(m.group (1), email))
continue
m = Ptest.search (Line) # Tested-by:
m = Ptest.match (Line) # Tested-by:
if m:
email = database.RemapEmail (m.group (2))
p.addtester (LookupStoreHacker (m.group (1), email))
p.author.testcredit (patch)
continue
m = Prep.search (Line) # Reported-by:
m = Prep.match (Line) # Reported-by:
if m:
email = database.RemapEmail (m.group (2))
p.addreporter (LookupStoreHacker (m.group (1), email))
p.author.reportcredit (patch)
continue
m = Preptest.search (Line) # Reported-and-tested-by:
m = Preptest.match (Line) # Reported-and-tested-by:
if m:
email = database.RemapEmail (m.group (2))
h = LookupStoreHacker (m.group (1), email)

View File

@@ -19,17 +19,17 @@ import re
Pemail = r'\s+"?([^<"]+)"?\s<([^>]+)>' # just email addr + name
Pcommit = re.compile (r'^commit ([0-9a-f ]+)$')
Pauthor = re.compile (r'^Author:' + Pemail + '$')
Psob = re.compile (r'Signed-off-by:' + Pemail)
Psob = re.compile (r'^\s+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:' + 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)
Preview = re.compile (r'^\s+Reviewed-by:' + Pemail + '.*$')
Ptest = re.compile (r'^\s+tested-by:' + Pemail + '.*$', re.I)
Prep = re.compile (r'^\s+Reported-by:' + Pemail + '.*$')
Preptest = re.compile (r'^\s+reported-and-tested-by:' + Pemail + '.*$', re.I)
#
# Merges are described with a variety of lines.
#