From 482f97961dc9d3c1eefe33656c521f48fa31a198 Mon Sep 17 00:00:00 2001 From: Bruno Postle Date: Wed, 7 Jun 2023 00:45:01 +0100 Subject: [PATCH] BlenderBIM fix Git merge log history (#3096) The GitPython commit() method isn't suitable for completing a merge as it only sets one parent, losing all history from the merged branch. --- src/blenderbim/blenderbim/bim/module/ifcgit/ui.py | 4 ++-- src/blenderbim/blenderbim/tool/ifcgit.py | 11 ++++------- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/src/blenderbim/blenderbim/bim/module/ifcgit/ui.py b/src/blenderbim/blenderbim/bim/module/ifcgit/ui.py index 536c14e852..0fdbe827d7 100644 --- a/src/blenderbim/blenderbim/bim/module/ifcgit/ui.py +++ b/src/blenderbim/blenderbim/bim/module/ifcgit/ui.py @@ -199,9 +199,9 @@ class COMMIT_UL_List(bpy.types.UIList): refs += "{" + tag.name + "} " if commit == current_revision: - layout.label(text="[HEAD] " + refs + commit.message, icon="DECORATE_KEYFRAME") + layout.label(text="[HEAD] " + refs + commit.message.split("\n")[0], icon="DECORATE_KEYFRAME") else: - layout.label(text=refs + commit.message, icon="DECORATE_ANIMATE") + layout.label(text=refs + commit.message.split("\n")[0], icon="DECORATE_ANIMATE") layout.label(text=time.strftime("%c", time.localtime(commit.committed_date))) diff --git a/src/blenderbim/blenderbim/tool/ifcgit.py b/src/blenderbim/blenderbim/tool/ifcgit.py index 3f8a08262f..0ac0871020 100644 --- a/src/blenderbim/blenderbim/tool/ifcgit.py +++ b/src/blenderbim/blenderbim/tool/ifcgit.py @@ -420,15 +420,12 @@ class IfcGit: operator.report({"ERROR"}, "Unknown IFC Merge failure") return False - repo.index.add(path_ifc) - - 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 + "\n\n" + message_summary - ) props.display_branch = repo.active_branch.name - cls.git_commit(path_ifc) + if os.name == "nt": + cls.dos2unix(path_ifc) + repo.index.add(path_ifc) + repo.git.commit("--no-edit") cls.load_project(path_ifc) cls.refresh_revision_list(path_ifc)