-
-
Notifications
You must be signed in to change notification settings - Fork 216
Merge editor now compare incoming changes with common ancestor commit #2203
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
The change set is smaller and more comprehensible.
It can happen that an element existed in the incoming branch, and has been removed in the current branch. In that case we should not fail.
@@ -182,7 +182,7 @@ def test_applied_stereotype(element_factory, modeling_language, create): | |||
apply_stereotype(class_item.subject, stereotype) | |||
|
|||
current = ElementFactory() | |||
all(compare(current, element_factory)) | |||
all(compare(current, current, element_factory)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For my understanding, are these tests now comparing the current against itself?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They conpare current against element_factory. The resulting changes are created in the current model.
I have to admit, the api is still a bit messy.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the explanation!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice update 👍
@danyeaw @amolenaar I'm trying to figure out how to exercise and use this functionality, but it's not obvious to me. I have a local git repo with my Can you describe steps to invoke the merge editor? Once I'm pointed in the right direction I'd be happy to contribute an example for the documentation if that'd be helpful |
Hi @bayerl, This behavior is activated when you have a merge conflict in git. So if you make changes on your branch, then open the model on the main branch and make some changes. If you merge the branch into main, and there are merge conflicts, you can still open the model woth Gaphor. This merge editor will show up and allow you to selectively add changes from your branch to the main branch. The docs are here: https://docs.gaphor.org/en/latest/merge_conflicts.html. Please let me know if (and where) it needs clarification. |
@amolenaar thanks for the fast response! Ok I got it. This approach makes sense. Very cool feature! I will be experimenting with this further. I did see the docs, which helped me discover this feature in the first place. I've suggested a slight modification that would've made it clear to me in PR #2914 |
@bayerl Thanks. I merge the PR. |
PR Type
What kind of change does this PR introduce?
What is the current behavior?
The list of changes in the merge editor is long and not easy to comprehend.
Issue Number: #388
What is the new behavior?
Instead of comparing the incoming with the current model, the incoming model is compared with a common ancestor node. As a result, the change set only contains the changes made in the incoming branch. Those changes can be applied to the model.
Does this PR introduce a breaking change?
Other information