diff options
author | Robert Adam <dev@robert-adam.de> | 2021-07-24 17:53:35 +0300 |
---|---|---|
committer | Robert Adam <dev@robert-adam.de> | 2021-07-24 17:53:35 +0300 |
commit | 3c3af619c06e3970f186955100fb8deabaaf2f24 (patch) | |
tree | f96eb40623e6b985d27f154762b47d6aa8b8086c | |
parent | a3e3d8ccb2a48dec0259b6b15fadbde4b6f59f61 (diff) |
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.
-rwxr-xr-x | scripts/generateChangelog.py | 6 |
1 files changed, 6 insertions, 0 deletions
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) |