finally get the config file stuff correct
[git-dm.git] / patterns.py
blobc833c3ec5eed7a05babee969d6a57ac79ea32c09
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.
12 import re
15 # Some people, when confronted with a problem, think "I know, I'll use regular
16 # expressions." Now they have two problems.
17 # -- Jamie Zawinski
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+(.*)$')
30 # Merges are described with a variety of lines.
32 PExtMerge = re.compile(r'^ +Merge( branch .* of)? ([^ ]+)\n$')
33 PIntMerge = re.compile(r'^ +(Merge|Pull) .* into .*$')
34 PIntMerge2 = re.compile(r"^ +Merge branch(es)? '.*$")