archimatetool / archi-modelrepository-plugin

coArchi - a plug-in to share and collaborate on Archi models.
153 stars 52 forks source link

Branch merge loses changes from one branch #93

Closed michaelansley closed 5 years ago

michaelansley commented 5 years ago

Hi,

I am trying to merge a branch to the master, but this is causing a loss of the changes to the master that have happened since the branch. This is not what I expected.

Am I correct in thinking that on merge, all of the changes to the master (assuming merge of a named branch to the master) would remain in place, and the changes to the branch (since the point of branching from the master) are merged into the master?

As a follow-up to this, what is best practice with respect to team working? Do people use forks and pull requests?

Regards... Michael

jbsarrodie commented 5 years ago

Am I correct in thinking that on merge, all of the changes to the master (assuming merge of a named branch to the master) would remain in place, and the changes to the branch (since the point of branching from the master) are merged into the master?

Yes, this is the definition of "merge" ;-)

this is causing a loss of the changes to the master that have happened since the branch

This should not happen

Phillipus commented 5 years ago

I think you need to provide more detail about your merge.

When you merge are there conflicts? If so, did you choose "Mine" or "Theirs" for each conflict?

Can you narrow things down?

michaelansley commented 5 years ago

Great, thanks Jean-Baptiste. I just needed to be sure that I wasn't being obviously stupid, having been out of the technical game for some time.

Phil, there were no conflicts. The changes to the branch are basically a bunch of new elements and relationships and some new views using only those new elements and relationships.

jbsarrodie commented 5 years ago

I am trying to merge a branch to the master, but this is causing a loss of the changes to the master that have happened since the branch. This is not what I expected.

Just in case... after having created the branch, did you (1) change existing objects/views or (2) did you create new ones? if (1), then after the merge you simply end up with the original objects updated and not both versions. If (2) you should end up with both versions.

WatchTh1 commented 5 years ago

I think I have issue in common. With collaborative work process going there is a need to structurize and make some agreements betwen contributors. There are 2 ways to solve it to teach each contributor through some process (my current option) and to restrict access to objects being modeled.

So i think going on with merging would require object authority implementation (kinda "This is mine, don't change attributes or relations if not authorized, and if changed - notify"). Is there such kind of functionality in plan?

пт, 29 мар. 2019 г. в 12:43, Jean-Baptiste Sarrodie < notifications@github.com>:

I am trying to merge a branch to the master, but this is causing a loss of the changes to the master that have happened since the branch. This is not what I expected.

Just in case... after having created the branch, did you (1) change existing objects/views or (2) did you create new ones? if (1), then after the merge you simply end up with the original objects updated and not both versions. If (2) you should end up with both versions.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/archimatetool/archi-modelrepository-plugin/issues/93#issuecomment-477933645, or mute the thread https://github.com/notifications/unsubscribe-auth/AlIkQ34ipXPz8cajyuAH28KH-mHBN4xRks5vbd_YgaJpZM4cQf-e .

michaelansley commented 5 years ago

In the branch, there were new objects and views created, and the views were limited to only those new objects in the branch. In parallel, the master was updated with a set of new objects. After merging the branch into the master, the new objects in the master have disappeared.

So, I think my expectations are justified and the behaviour is unexpected.

Phillipus commented 5 years ago

If it is a bug or issue, the only way to address it is with a reproducible sequence of events. Can you provide this?

Phillipus commented 5 years ago

One thing you could do is take a look at the commit log for that repo in another git tool such as SmartGit and see what happened at the point of merge.

michaelansley commented 5 years ago

Thanks Phil. I had some similar behaviour again yesterday in a smaller test case, and I have now planned to set up a test model and work through the steps required tomorrow. So I hope to post that in the next few days. I'll definitely take a look at the Git log tool you suggest.

michaelansley commented 5 years ago

A colleague of mine and I spent some time to go over this and try to find the problem, and eventually, we uncovered it. I was making some invalid assumptions about the way refreshes work in Git (I assumed a refresh was for all branches, not just the current branch), and on top of that, I'm reasonably certain that I was making local merges, and then getting confused about the impact that had later. So, all in all, this issue appears to be down to my own stupidity.

Thanks for the help and attention, Phil.