BlenderBIM use git shortlog to summarise merge log

This commit is contained in:
Bruno Postle
2023-06-05 21:22:16 +01:00
parent 98f2bd66b6
commit a851689bca
+3 -9
View File
@@ -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)