Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Compare » Resolving EGit Conflicts with EMF Compare(Resolving EGit Conflicts with EMF Compare)
Resolving EGit Conflicts with EMF Compare [message #1763988] Tue, 23 May 2017 16:37 Go to next message
Mark Kikken is currently offline Mark KikkenFriend
Messages: 2
Registered: May 2017
Junior Member
I've recently been investigating the use of EMF Compare for resolving EGit Merge Conflicts in EMF Models. Even though the usecase sounds as one of the basic ones supported by EMF Compare, I found that a lot of things just don't work and I needed to create a manual for the development team on how to work around these limitations. I wanted to share these workarounds with you in order to provide some feedback an maybe find a mistake on my part. I've been using Eclipse Neon 3 and the latest stable EMF Compare release (org.eclipse.emf.compare.ide.ui_4.3.0.201611041634, org.eclipse.emf.compare.ide_3.4.0.201611041634 and org.eclipse.emf.compare.egit_1.2.0.201611041634).

First, there is the problem that the save button does not work. As far as I understand what can be found on this forum and on the wiki, this might have something to do with EGit not handling that action correctly. It should know that the left representation of the model actually corresponds to the file in the workspace and should be saved there. The problem seems to be complicated though, beacause models can span multiple files.
I needed to resort to copying the XML from the 'By Resource' selection, when selecting the file resource itself. That XML can then manually be saved in the file on disk. A working save button would make the manual merge process a lot smoother, though.
On a related note: sometimes the save button is greyed out alltogether, even though changes have been made to the model.

Second, when applying all remaining non-conflicting changes from right to left, these changes do show up as merged in the Compare View, but don't show up in the beforementioned XML representation. I guess it's a bug, since the problem does not occur when I pick the changes one-by-one (which is our current workaround).

Third, I find it quite confusing that the tooltip on the 'Apply all from Right to Left' Icon mentions that it will apply all changes, whereas the Action in the contextmenu mentions that it will only apply Non-conflicting Changes, but uses the same Icon. I'm guessing it is actually the same action, but I'm not sure.


If there is a way of easily fixing some of the issues, I would gladly do so.


Thanks in advance for your comments.



Mark
Re: Resolving EGit Conflicts with EMF Compare [message #1764344 is a reply to message #1763988] Sun, 28 May 2017 18:20 Go to previous messageGo to next message
Philip Langer is currently offline Philip LangerFriend
Messages: 99
Registered: March 2015
Location: Vienna, Austria
Member

Hi Mark,

thanks for providing feedback! It is great that you are taking the time to help improving EMF Compare.

Quote:
First, there is the problem that the save button does not work. As far as I understand what can be found on this forum and on the wiki, this might have something to do with EGit not handling that action correctly. It should know that the left representation of the model actually corresponds to the file in the workspace and should be saved there. The problem seems to be complicated though, beacause models can span multiple files.
I needed to resort to copying the XML from the 'By Resource' selection, when selecting the file resource itself. That XML can then manually be saved in the file on disk. A working save button would make the manual merge process a lot smoother, though.
On a related note: sometimes the save button is greyed out alltogether, even though changes have been made to the model.


To me it sounds like you are not using the intended workflow of resolving conflicts, since what you describe more sounds like a comparison and not like the Model Merge tool. How did you start the conflict resolution?

In case of conflicts after a git merge / rebase, we recommend to start the conflict resolution by opening Team -> Model Merge Tool (EMF Compare). There, the right-click options should be called accept/reject and Save should just overwrite the local workspace files, which can then be staged to finalize the conflict resolution.

On the same note, we only truly support starting comparisons by right-clicking a model and go to Compare -> With branch/ref/etc. Comparisons started from history view or from the staging view are not really supported very well.

In fully customized modeling products, we typically streamline the UI so that only the supported ways of resolving conflicts and starting comparisons are visible.

Quote:
Second, when applying all remaining non-conflicting changes from right to left, these changes do show up as merged in the Compare View, but don't show up in the beforementioned XML representation. I guess it's a bug, since the problem does not occur when I pick the changes one-by-one (which is our current workaround).


Not sure I understand exactly what you mean, but the effect of the merged changes only show up in the XMI file _after_ you have saved the comparison editor. Until you save, all your merge operations are only applied in memory and only the save operation will serialize the updated models. This is true for comparisons as well as for model merge sessions.

Quote:
Third, I find it quite confusing that the tooltip on the 'Apply all from Right to Left' Icon mentions that it will apply all changes, whereas the Action in the contextmenu mentions that it will only apply Non-conflicting Changes, but uses the same Icon. I'm guessing it is actually the same action, but I'm not sure.


Which actions exactly do you mean? It'd be great if you could post a screenshot.

Thanks a lot and best wishes,

Philip

--
Philip Langer

Get professional Eclipse developer support:
http://eclipsesource.com/en/services/developer-support/


--
Philip Langer

Get professional Eclipse developer support:
http://eclipsesource.com/en/services/developer-support/
Re: Resolving EGit Conflicts with EMF Compare [message #1764527 is a reply to message #1764344] Tue, 30 May 2017 22:26 Go to previous messageGo to next message
Mark Kikken is currently offline Mark KikkenFriend
Messages: 2
Registered: May 2017
Junior Member
Hi Philip,


Thank you for your reply, I think you've already pointed out a crucial detail to me. What I thought of as the most logical workflow was simply double-clicking the Conflict in the EGit 'Git Staging' view. That action would open EMF Compare and showed a 3-Way Merge of the conflict. I did not realize this is something quite different from 'Team -> Model Merge Tool (With EMF Compare)'. This might be the wrong place to ask, but do you know if there is a simple way of associating the 'Git Staging' view Merge Editor with the correct way of opening EMF Compare?

Now, when doing the 3-Way Merge the right way (Model Merge Tool), it takes ages starting while displaying 'Checking resources' on a splash screen. I guess it is now actually trying to resolve proxies and building its Logical Model. I will have to find a way of speeding this process up, I guess I will have to do something with the 'modelDependencyProvider' extension point in order to improve on that.
Right now, I can't tell you if anything improves in the Model Merge Tool mode, since it's still loading. I might come back to that later on.

I would still like to clarify what I was doing in the 'wrong' merge-mode, since I do think there is a bug in EMF Compare that normally really does not affect users that much, but is quite anoying when using it the way I was using it. What I was doing:
After opening the 3-Way Merge by double-clicking the conflict in the 'Git Staging' View, I would first resolve conflicts as usual and apply all non-conflicting changes to the left-hand-side. When satisfied with the result, I would select the grouping 'by resource' and select the file resource I'm interested in:
index.php/fa/29484/0/
That would show the merged XML on the left-hand-side (and the right-hand-side af well, of course) and allow me to copy-paste it into the actual file it should be written to.

This almost worked perfectly, except for that that it would only include merged differences that had been merged using the index.php/fa/29485/0/ icon. Changes merged using index.php/fa/29486/0/ do not show up in the shown XML. I have no explaination for this execpt that it probably is a bug.


Regards,

Mark

[Updated on: Tue, 30 May 2017 22:31]

Report message to a moderator

Re: Resolving EGit Conflicts with EMF Compare [message #1764575 is a reply to message #1764527] Wed, 31 May 2017 11:58 Go to previous message
Philip Langer is currently offline Philip LangerFriend
Messages: 99
Registered: March 2015
Location: Vienna, Austria
Member

Hi,

Quote:
This might be the wrong place to ask, but do you know if there is a simple way of associating the 'Git Staging' view Merge Editor with the correct way of opening EMF Compare?


A while ago, the EMF Compare team analyzed the integration effort and it was found to be pretty high as the Staging View (back then) wasn't very extensible. Not sure about the situation now. It may be easier if you are in a closed environment (isolated RCP vs something you want to be installable into any Eclipse IDE).

Quote:
Now, when doing the 3-Way Merge the right way (Model Merge Tool), it takes ages starting while displaying 'Checking resources' on a splash screen. I guess it is now actually trying to resolve proxies and building its Logical Model. I will have to find a way of speeding this process up, I guess I will have to do something with the 'modelDependencyProvider' extension point in order to improve on that.


Note that we did some major performance improvements over the last days, which will be included in the Oxygen release. So you can try with the current Oxygen release candidate to see if the situation improved.

Quote:
This almost worked perfectly, except for that that it would only include merged differences that had been merged using the index.php/fa/29485/0/ icon. Changes merged using index.php/fa/29486/0/ do not show up in the shown XML. I have no explaination for this execpt that it probably is a bug.


Hm, sounds like a bug... do you have a small example to reproduce the issue that you can share? Please feel free to open a bug report with steps to reproduce.

Thanks and best wishes,

Philip


--
Philip Langer

Get professional Eclipse developer support:
http://eclipsesource.com/en/services/developer-support/
Previous Topic:Newbie Guide to Creating Custom Matching Strategy
Next Topic:[EMF Compare] Merge action not properly done
Goto Forum:
  


Current Time: Mon Dec 09 05:17:32 GMT 2024

Powered by FUDForum. Page generated in 0.03235 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top