From 8c016ff854bcd87f8169af005aef56872838bf9d Mon Sep 17 00:00:00 2001 From: Sherkey <57581480+SherkeyXD@users.noreply.github.com> Date: Fri, 15 Dec 2023 00:13:04 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E6=9B=B4=E6=94=B9changelog=E7=94=9F?= =?UTF-8?q?=E6=88=90=E6=97=B6=E6=A3=80=E6=9F=A5coauthor=E7=9A=84=E9=80=BB?= =?UTF-8?q?=E8=BE=91=20(#7589)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tools/ChangelogGenerator/changelog_generator.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tools/ChangelogGenerator/changelog_generator.py b/tools/ChangelogGenerator/changelog_generator.py index f057c0f998..85a784f318 100644 --- a/tools/ChangelogGenerator/changelog_generator.py +++ b/tools/ChangelogGenerator/changelog_generator.py @@ -254,13 +254,15 @@ def main(tag_name=None, latest=None): continue git_addition_command = rf'git log {commit_hash} --no-walk --pretty=format:"%b"' addition = call_command(git_addition_command) - coauthors = [] + coauthors = set() for coauthor in re.findall(r"Co-authored-by: (.*) <(?:.*)>", addition): if coauthor in contributors: - coauthors.append(contributors[coauthor]) + coauthors.add(contributors[coauthor]) + elif coauthor in contributors.values(): + coauthors.add(coauthor) else: print(f"Cannot get coauthor: {coauthor}.") - raw_commits_info[commit_hash]["coauthors"] = coauthors + raw_commits_info[commit_hash]["coauthors"] = list(coauthors) git_skip_command = rf'git log {latest}..HEAD --pretty=format:"%H%n" --grep="\[skip changelog\]"' raw_gitlogs = call_command(git_skip_command)