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.
This commit is contained in:
Bruno Postle
2023-06-07 00:45:01 +01:00
parent 236c064849
commit 482f97961d
2 changed files with 6 additions and 9 deletions
@@ -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)))
+4 -7
View File
@@ -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)