From 3c3af619c06e3970f186955100fb8deabaaf2f24 Mon Sep 17 00:00:00 2001 From: Robert Adam Date: Sat, 24 Jul 2021 16:53:35 +0200 Subject: MAINT: Make changelog script work with backports Merge commits of backports follow a little different pattern than regular merge commits. This has to be accounted for in the script generating the changelog. --- scripts/generateChangelog.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'scripts') diff --git a/scripts/generateChangelog.py b/scripts/generateChangelog.py index 2bcaa13f4..507c3626c 100755 --- a/scripts/generateChangelog.py +++ b/scripts/generateChangelog.py @@ -38,6 +38,7 @@ def main(): args = parser.parse_args() mergeCommitPattern = re.compile("^([0-9a-f]+)\s*[Mm]erge\s.+?#(\d+):?\s*(.+)$", re.MULTILINE) + backportCommitPattern = re.compile("^[Bb]ackport\s*\"(.*)\".*$") commits = cmd(["git", "log" ,"--format=oneline", "--date=short", "{}..{}".format(args.FROM_TAG, args.TO_TAG)]).split("\n") @@ -60,6 +61,11 @@ def main(): prNumber = match.group(2) commitTitle = match.group(3) + backportMatch = re.match(backportCommitPattern, commitTitle) + if backportMatch: + # This commit is a backport commit where the actual commit title is the bit in the quotes + commitTitle = backportMatch.group(1) + try: commit = CommitMessage(commitTitle) -- cgit v1.2.3