aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKonstantin Ryabitsev <konstantin@linuxfoundation.org>2020-07-06 18:07:59 -0400
committerKonstantin Ryabitsev <konstantin@linuxfoundation.org>2020-07-06 18:09:41 -0400
commit6bf644f14b3f5ad5d1adf028b850fe8245234fac (patch)
tree82cd7f544f0bcc70902003bfe21cedd26dbdfbff
parentf9b6c0053a017125b46014a6b7bb026943bc4405 (diff)
downloadb4-6bf644f14b3f5ad5d1adf028b850fe8245234fac.tar.gz
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 <broonie@kernel.org> Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
-rw-r--r--b4/__init__.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/b4/__init__.py b/b4/__init__.py
index c85b85e..e0403ec 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)