From 87520ff52ce4531bd6ae271fc2ce29e46e8b4638 Mon Sep 17 00:00:00 2001 From: Zhao Mengmeng Date: Fri, 28 Jun 2024 16:12:28 +0800 Subject: [PATCH] pr: regex support tag with + character Conor Dooley reported that `b4 pr 20240627-wobbly-custody-5df564133088@spud` failed, the root cause is reporef_re matches failed when there is extra + sign, though it is not recommend to have special characters in tag name, but git accepts this and we better fix it. Link: https://bugzilla.kernel.org/show_bug.cgi?id=218995 Signed-off-by: Zhao Mengmeng --- src/b4/pr.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/b4/pr.py b/src/b4/pr.py index 2d0ce23..0b0299a 100644 --- a/src/b4/pr.py +++ b/src/b4/pr.py @@ -38,7 +38,8 @@ # I don't like these PULL_BODY_REMOTE_REF_RE = [ - re.compile(r'^\s*([\w+-]+(?:://|@)[\w/.@:~-]+)[\s\\]+([\w/._-]+)\s*$', re.M | re.I), + # match string like: "https://git.kernel.org/pub/scm/linux/kernel/git/conor/linux.git/ riscv-dt-fixes-for-v6.10-rc5+" + re.compile(r'^\s*([\w+-]+(?:://|@)[\w/.@:~-]+)[\s\\]+([\w/._+-]+)\s*$', re.M | re.I), re.compile(r'^\s*([\w+-]+(?:://|@)[\w/.@~-]+)\s*$', re.M | re.I), ]