2 # Pull together regular expressions used in multiple places.
4 # This code is part of the LWN git data miner.
6 # Copyright 2007-8 LWN.net
7 # Copyright 2007-8 Jonathan Corbet <corbet@lwn.net>
9 # This file may be distributed under the terms of the GNU General
10 # Public License, version 2.
15 # Some people, when confronted with a problem, think "I know, I'll use regular
16 # expressions." Now they have two problems.
19 Pemail
= r
'\s+"?([^<"]+)"?\s<([^>]+)>' # just email addr + name
20 Pcommit
= re
.compile (r
'^commit ([0-9a-f ]+)$')
21 Pauthor
= re
.compile (r
'^Author:' + Pemail
+ '$')
22 Psob
= re
.compile (r
'Signed-off-by:' + Pemail
)
23 Pmerge
= re
.compile (r
'^Merge:.*$')
24 Padd
= re
.compile (r
'^\+[^\+].*$')
25 Prem
= re
.compile (r
'^-[^-].*$')
26 Pdate
= re
.compile (r
'^(Commit)?Date:\s+(.*)$')
27 Pfilea
= re
.compile (r
'^---\s+(.*)$')
28 Pfileb
= re
.compile (r
'^\+\+\+\s+(.*)$')
29 Preview
= re
.compile (r
'Reviewed-by:' + Pemail
)
30 Ptest
= re
.compile (r
' tested-by:' + Pemail
, re
.I
)
31 Prep
= re
.compile (r
'Reported-by:' + Pemail
)
32 Preptest
= re
.compile (r
'reported-and-tested-by:' + Pemail
, re
.I
)
34 # Merges are described with a variety of lines.
36 PExtMerge
= re
.compile(r
'^ +Merge( branch .* of)? ([^ ]+:[^ ]+)\n$')
37 PIntMerge
= re
.compile(r
'^ +(Merge|Pull) .* into .*$')
38 PIntMerge2
= re
.compile(r
"^ +Merge branch(es)? '.*$")