Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mumble-voip/mumble.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Adam <dev@robert-adam.de>2021-03-20 22:31:43 +0300
committerGitHub <noreply@github.com>2021-03-20 22:31:43 +0300
commitf8dc8b07798436dda278b172a0c62c7f8fac10d8 (patch)
tree31f48c42ca41ba599178a10e912023fb191c2c3e
parent192b3b936821289feb97b3fa0d7d6de0e74079a3 (diff)
parent8a9a915c1be0d02b54b994e2875a3b08f9443fc2 (diff)
Merge pull request #4879: MAINT: Changelog script improvements1.4.0-development-snapshot-003
This PR concentrates on improvements of the generateChangelog.py script.
-rwxr-xr-xscripts/generateChangelog.py63
1 files changed, 32 insertions, 31 deletions
diff --git a/scripts/generateChangelog.py b/scripts/generateChangelog.py
index f6cf1c03c..f5f584d35 100755
--- a/scripts/generateChangelog.py
+++ b/scripts/generateChangelog.py
@@ -8,6 +8,7 @@
import argparse
import platform
import subprocess
+import re
from commitMessage.CommitMessage import CommitMessage, CommitFormatError
@@ -19,19 +20,6 @@ def cmd(args):
raise Exception('cmd(): {0} failed with status {1}: {2}'.format(args, p.returncode, stderr))
return stdout.decode('utf-8')
-def isRelevantCommit(commitLine):
- if commitLine.strip() == "":
- return False
-
- components = commitLine.split()
-
- if len(components) < 2:
- return False
-
- # First component is commit hash
- # We only consider merge commits to be relevant
- return components[1].lower() == "merge"
-
def formatChangeLine(line, prNumber, target):
if target == "github":
return "- {} (#{})".format(line, prNumber)
@@ -49,32 +37,28 @@ def main():
default="other")
args = parser.parse_args()
+ mergeCommitPattern = re.compile("^([0-9a-f]+)\s*[Mm]erge\s.+?#(\d+):?\s*(.+)$", re.MULTILINE)
+
commits = cmd(["git", "log" ,"--format=oneline", "--date=short", "{}..{}".format(args.FROM_TAG, args.TO_TAG)]).split("\n")
- commits = list(filter(isRelevantCommit, commits))
- serverChanges = []
- clientChanges = []
- sharedChanges = []
- miscChanges = []
+ serverChanges = []
+ clientChanges = []
+ sharedChanges = []
+ positionalAudioChanges = []
+ miscChanges = []
skipTypes = set(["FORMAT", "DOCS", "TEST", "MAINT", "CI", "REFAC", "BUILD", "TRANSLATION"])
for commitLine in commits:
- parts = commitLine.split(maxsplit=1)
- commitHash = parts[0]
- commitTitle = parts[1]
-
- assert ":" in commitTitle
- assert "#" in commitTitle
+ match = re.match(mergeCommitPattern, commitLine)
- prTagStart = commitTitle.find("#")
- prTagEnd = commitTitle.find(":")
- assert prTagStart + 1 < prTagEnd
+ if not match:
+ # Commit doesn't match the expected pattern and is thus ignored
+ continue
- # Extract PR number
- prNumber = commitTitle[prTagStart + 1 : prTagEnd]
- # Cut out PR information from commit title
- commitTitle = commitTitle[prTagEnd + 1 : ].strip()
+ commitHash = match.group(1)
+ prNumber = match.group(2)
+ commitTitle = match.group(3)
try:
commit = CommitMessage(commitTitle)
@@ -90,6 +74,16 @@ def main():
targetGroups.append(serverChanges)
if "shared" in commit.m_scopes:
targetGroups.append(sharedChanges)
+ if "positional-audio" in commit.m_scopes:
+ targetGroups.append(positionalAudioChanges)
+ if "ice" in commit.m_scopes and not "server" in commit.m_scopes:
+ targetGroups.append(serverChanges)
+ commit.m_summary = "Ice: " + commit.m_summary
+ if "grpc" in commit.m_scopes and not "server" in commit.m_scopes:
+ targetGroups.append(serverChanges)
+ commit.m_summary = "gRPC: " + commit.m_summary
+ if "audio" in commit.m_scopes and not "client" in commit.m_scopes:
+ targetGroups.append(clientChanges)
if len(targetGroups) == 0:
targetGroups.append(miscChanges)
@@ -129,6 +123,13 @@ def main():
print()
print()
+ if len(positionalAudioChanges) > 0:
+ print("### Positional audio plugins")
+ print()
+ print("\n".join(sorted(positionalAudioChanges)))
+ print()
+ print()
+
if len(miscChanges):
print("### Miscellaneous")
print()