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 Pcommit
= re
.compile (r
'^commit ([0-9a-f ]+)$')
20 Pauthor
= re
.compile (r
'^Author: ([^<]+)\s<([^>]+)>$')
21 Psob
= re
.compile (r
'Signed-off-by:\s+([^<]+)\s+<([^>]+)>')
22 Pmerge
= re
.compile (r
'^Merge:.*$')
23 Padd
= re
.compile (r
'^\+[^\+].*$')
24 Prem
= re
.compile (r
'^-[^-].*$')
25 Pdate
= re
.compile (r
'^(Commit)?Date:\s+(.*)$')
26 Pfilea
= re
.compile (r
'^---\s+(.*)$')
27 Pfileb
= re
.compile (r
'^\+\+\+\s+(.*)$')
28 Preview
= re
.compile (r
'Reviewed-by:\s+([^<]+)\s+<([^>]+)>')
29 Ptest
= re
.compile (r
' tested-by:\s+([^<]+)\s+<([^>]+)>', re
.I
)
30 Prep
= re
.compile (r
'Reported-by:\s+([^<]+)\s+<([^>]+)>')
31 Preptest
= re
.compile (r
'reported-and-tested-by:\s+([^<]+)\s+<([^>]+)>', re
.I
)
33 # Merges are described with a variety of lines.
35 PExtMerge
= re
.compile(r
'^ +Merge( branch .* of)? ([^ ]+)\n$')
36 PIntMerge
= re
.compile(r
'^ +(Merge|Pull) .* into .*$')
37 PIntMerge2
= re
.compile(r
"^ +Merge branch(es)? '.*$")