]> xenbits.xensource.com Git - people/larsk/xenproject-org-gitdm.git/commitdiff
Make tag matching stricter
authorJonathan Corbet <corbet@lwn.net>
Mon, 4 Oct 2010 23:06:33 +0000 (17:06 -0600)
committerJonathan Corbet <corbet@lwn.net>
Mon, 4 Oct 2010 23:06:33 +0000 (17:06 -0600)
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>
gitdm
patterns.py

diff --git a/gitdm b/gitdm
index 93ac0fc546b6cc1feb2b2b4e109d4971d8804fb3..dce5d3c0da6b5bb6f390fc81404f9a66caab441e 100755 (executable)
--- 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)
index f912d9a6b4a81a4ce1d65fc924878bafd24c4179..d3495b800a158da7c1ceeb5aae29950b2514d115 100644 (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.
 #