summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Corbet <corbet@lwn.net>2010-10-04 17:06:33 -0600
committerJonathan Corbet <corbet@lwn.net>2010-10-04 17:06:33 -0600
commitf64e9ffbd8f93d1c9d89f7e7bc6d72a6c80cb7e0 (patch)
treeae45ae8b2b75e23dc9bb12fc9fdff9ab7f62afd5
parentea23ca50c0d3ba5e51a5d00c4811b99b889a521a (diff)
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>
-rwxr-xr-xgitdm10
-rw-r--r--patterns.py10
2 files changed, 10 insertions, 10 deletions
diff --git a/gitdm b/gitdm
index 93ac0fc..dce5d3c 100755
--- a/gitdm
+++ b/gitdm
@@ -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)
diff --git a/patterns.py b/patterns.py
index f912d9a..d3495b8 100644
--- a/patterns.py
+++ b/patterns.py
@@ -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.
#