Files
gitdm/patterns.py
Jonathan Corbet f64e9ffbd8 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>
2010-10-04 17:06:33 -06:00

40 lines
1.4 KiB
Python

#
# Pull together regular expressions used in multiple places.
#
# This code is part of the LWN git data miner.
#
# Copyright 2007-8 LWN.net
# Copyright 2007-8 Jonathan Corbet <corbet@lwn.net>
#
# This file may be distributed under the terms of the GNU General
# Public License, version 2.
#
import re
#
# Some people, when confronted with a problem, think "I know, I'll use regular
# 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:' + 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'^\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.
#
PExtMerge = re.compile(r'^ +Merge( branch .* of)? ([^ ]+:[^ ]+)\n$')
PIntMerge = re.compile(r'^ +(Merge|Pull) .* into .*$')
# PIntMerge2 = re.compile(r"^ +Merge branch(es)? '.*$")
PIntMerge2 = re.compile(r"^ +Merge .*$")