From 46c29287b1284e3d5de32107dbfca752fd40c8ed Mon Sep 17 00:00:00 2001 From: Konstantin Ryabitsev Date: Mon, 6 Jul 2020 18:07:59 -0400 Subject: Deal with [PATCHvX] subjects Normally, we'd expect to always have a space between PATCH and other prefixes, but be forgiving if it's not present. Reported-by: Mark Brown Signed-off-by: Konstantin Ryabitsev --- b4/__init__.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/b4/__init__.py b/b4/__init__.py index 37d8293..37121be 100644 --- a/b4/__init__.py +++ b/b4/__init__.py @@ -1379,6 +1379,9 @@ class LoreSubject: self.reply = True subject = re.sub(r'^\w+:\s*\[', '[', subject) + # Fix [PATCHv3] to be properly [PATCH v3] + subject = re.sub(r'^\[\s*(patch)(v\d+).*', '[$1 $2$3', subject, flags=re.I) + # Find all [foo] in the title while subject.find('[') == 0: matches = re.search(r'^\[([^\]]*)\]', subject) -- cgit v1.2.3