]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Fix ordering of gitchangelog replacement regexs
authorNicki Křížek <nicki@isc.org>
Tue, 13 Aug 2024 08:33:02 +0000 (10:33 +0200)
committerNicki Křížek <nicki@isc.org>
Wed, 14 Aug 2024 15:11:59 +0000 (15:11 +0000)
Prior to this change, the issue number could be accidentally removed by
the `Backport of` text, depending on the order of the MR description
contents. Ensure all the removals for text in MR descriptions happen
first, and only then run the replacement regex for issue number, which
appends it to the end of the last non-empty line (which will no longer
be removed).

The only removals that happen after the replacement are guaranteed to
always happen after the end of MR description, since they're
auto-generated by gitlab when the merge commit is created, thus won't
affect the line with the issue number.

Also remove the needless isc-private/bind9 replacement. References
to private MRs are already removed by the very first regex.

(cherry picked from commit 37274bebe147a1dc95565e3e1bbb2c112778ecbf)

contrib/gitchangelog/changelog.rc.py
contrib/gitchangelog/relnotes.rc.py

index e2fd2cf42e0e3e5646efa7bd09379d40ed79df33..7f8182a5742b58b1a9a208430579a4ad4821e120 100644 (file)
@@ -158,14 +158,13 @@ body_process = (
     ReSub(r"\n*See merge request isc-private/bind9!\d+", r"")
     | ReSub(r"https://gitlab.isc.org/isc-projects/bind9/-/issues/", r"#")
     | ReSub(r"https://gitlab.isc.org/isc-projects/bind9/-/merge_requests/", r"!")
+    | ReSub(r"\n*Backport of [^\n]+", r"")
+    | ReSub(r"\n*(Replaces|Supersedes)[^\n]+", r"")
     | ReSub(
         r"\n*(Closes|Fixes|Related|See):?\s*(isc-projects/bind9)?((#|!)\d+)",
         r" :gl:`\3`",
     )
-    | ReSub(r"\n*Backport of [^\n]+", r"")
-    | ReSub(r"\n*(Replaces|Supersedes)[^\n]+", r"")
     | ReSub(r"\n*Merge branch '[^']+' into [^\n]+", r"")
-    | ReSub(r"\n*isc-private/bind9", r"")
     | ReSub(r"\n*See merge request isc-projects/bind9(!\d+)", r" :gl:`\1`")
     | Wrap(regexp="\n\n", separator="\n\n")
     | strip
index dd1a8722c5972215a873a14edec2ddf39aa85339..8430c7f70c3effd03b13b87b41380f814a6b6bd4 100644 (file)
@@ -39,14 +39,13 @@ body_process = (
     ReSub(r"\n*See merge request isc-private/bind9!\d+", r"")
     | ReSub(r"https://gitlab.isc.org/isc-projects/bind9/-/issues/", r"#")
     | ReSub(r"https://gitlab.isc.org/isc-projects/bind9/-/merge_requests/", r"!")
+    | ReSub(r"\n*Backport of [^\n]+", r"")
+    | ReSub(r"\n*(Replaces|Supercedes)[^\n]+", r"")
     | ReSub(
         r"\n*(Closes|Fixes|Related|See):?\s*(isc-projects/bind9)?((#|!)\d+)",
         r" :gl:`\3`",
     )
-    | ReSub(r"\n*Backport of [^\n]+", r"")
-    | ReSub(r"\n*(Replaces|Supercedes)[^\n]+", r"")
     | ReSub(r"\n*Merge branch '[^']+' into [^\n]+", r"")
-    | ReSub(r"\n*isc-private/bind9", r"")
     | ReSub(r"\n*See merge request isc-projects/bind9(!\d+)", r" :gl:`\1`")
     | Wrap(regexp="\n\n", separator="\n\n")
     | strip