mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager
synced 2024-10-14 12:05:03 +00:00
scripts: allow marking commits with "Ignore-Backport:" in "find-backports" script
"find-backports" searches commit messages of upstream branches for "Fixes:" comments. Those will then be highlighted to be backported, if the script determines that to be necessary. "find-backports" also honors the "cherry picked from" comments, to detect when a patch was already backported. That is thus a way to suppress reporting a commit to be backported. Add another way to flag commits so they don't need backporting. Via "Ignore-Backport:" tag. As "find-backports" also honors "refs/notes/bugs" notes, this can be used like: git notes \ --ref refs/notes/bugs \ append \ -m "Ignore-Backport: e""29f00fa0c69 ('NEWS: fix entry that is targeted for 1.30 instead of 1.28')" \ 2''3364aa8f3bd6b11e2ac9e30117eaabfe1f3a9f2
This commit is contained in:
parent
0f26529bb3
commit
87749642e2
|
@ -151,7 +151,7 @@ def git_ref_commit_body(ref):
|
||||||
def git_ref_commit_body_get_fixes(ref):
|
def git_ref_commit_body_get_fixes(ref):
|
||||||
body = git_ref_commit_body(ref)
|
body = git_ref_commit_body(ref)
|
||||||
result = []
|
result = []
|
||||||
for mo in re.finditer(re_bin("[fF]ixes: *([0-9a-z]+).*"), body):
|
for mo in re.finditer(re_bin("\\b[fF]ixes: *([0-9a-z]+)\\b"), body):
|
||||||
c = mo.group(1).decode("ascii")
|
c = mo.group(1).decode("ascii")
|
||||||
h = git_ref_exists(c)
|
h = git_ref_exists(c)
|
||||||
if h:
|
if h:
|
||||||
|
@ -166,16 +166,18 @@ def git_ref_commit_body_get_cherry_picked_one(ref):
|
||||||
return None
|
return None
|
||||||
body = git_ref_commit_body(ref)
|
body = git_ref_commit_body(ref)
|
||||||
result = None
|
result = None
|
||||||
for mo in re.finditer(
|
for r in [
|
||||||
re_bin(".*\(cherry picked from commit ([0-9a-z]+)\).*"), body
|
re_bin("\(cherry picked from commit ([0-9a-z]+)\)"),
|
||||||
):
|
re_bin("\\bIgnore-Backport: *([0-9a-z]+)\\b"),
|
||||||
c = mo.group(1).decode("ascii")
|
]:
|
||||||
h = git_ref_exists(c)
|
for mo in re.finditer(r, body):
|
||||||
if h:
|
c = mo.group(1).decode("ascii")
|
||||||
if not result:
|
h = git_ref_exists(c)
|
||||||
result = [h]
|
if h:
|
||||||
else:
|
if not result:
|
||||||
result.append(h)
|
result = [h]
|
||||||
|
else:
|
||||||
|
result.append(h)
|
||||||
return result
|
return result
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue