From a851689bca0db0a09e58c70ac9a406770eb5131b Mon Sep 17 00:00:00 2001 From: Bruno Postle Date: Mon, 5 Jun 2023 21:22:16 +0100 Subject: [PATCH] BlenderBIM use git shortlog to summarise merge log --- src/blenderbim/blenderbim/tool/ifcgit.py | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/src/blenderbim/blenderbim/tool/ifcgit.py b/src/blenderbim/blenderbim/tool/ifcgit.py index f50f2e18ab..3f8a08262f 100644 --- a/src/blenderbim/blenderbim/tool/ifcgit.py +++ b/src/blenderbim/blenderbim/tool/ifcgit.py @@ -1,6 +1,5 @@ import os import re -import time # allows git import even if git executable isn't found os.environ["GIT_PYTHON_REFRESH"] = "quiet" @@ -423,18 +422,13 @@ class IfcGit: repo.index.add(path_ifc) - message_summary = "" - branch_commits = repo.iter_commits(rev=repo.active_branch.name + ".." + props.display_branch) - for commit in branch_commits: - message_summary += "\n\n" + commit.author.name + " <" + commit.author.email + ">\n" - message_summary += time.strftime("%c", time.localtime(commit.committed_date)) + "\n" - message_summary += commit.message - + message_summary = repo.git.shortlog(repo.active_branch.name + ".." + props.display_branch) props.commit_message = ( - "Merge branch '" + props.display_branch + "' into " + repo.active_branch.name + message_summary + "Merge branch '" + props.display_branch + "' into " + repo.active_branch.name + "\n\n" + message_summary ) props.display_branch = repo.active_branch.name + cls.git_commit(path_ifc) cls.load_project(path_ifc) cls.refresh_revision_list(path_ifc)