Skip to contentSkip to conversation

Fix handling of series with the [PATCHvX] defect

PATCH In review Marc Zyngier 2 participants 2 messages Oct 30, 2020 – Nov 3, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix handling of series with the [PATCHvX] defect

b4 tries to handle subject lines such as "[PATCHvX]" by replacing the subject line in situ, but seems to do a rather bad job of it, resulting in only the first patch of the series being picked up. Fetching <[email protected]> does exhibit the problem.

Fixing the re.sub() expression allows normal funtionalities to be restored, and the above series to be fetched.

Fixes 6bf644f14b3f ("Deal with [PATCHvX] subject")
---
 b4/__init__.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
b4/__init__.py +1 -1
index a1479aa..c6d43b2 100644
@@ -1389,7 +1389,7 @@ class LoreSubject:
             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)
+        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:
Signature · 1 line
2.28.0
#1 lore raw
Quoted 8 lines · Marc Zyngier

b4 tries to handle subject lines such as "[PATCHvX]" by replacing the subject line in situ, but seems to do a rather bad job of it, resulting in only the first patch of the series being picked up. Fetching <[email protected]> does exhibit the problem.

Fixing the re.sub() expression allows normal funtionalities to be restored, and the above series to be fetched.

Thanks, I have no idea how that bad regex made it in. Applied both to master and stable-0.5.y.

-K