mergepbx icon indicating copy to clipboard operation
mergepbx copied to clipboard

merging failed: can not merge projects with objectVersion 50

Open NicolasRiviere opened this issue 5 years ago • 7 comments

Hello !

First of all, thank you very much for creating and contributing to MergePbx. It saves me so much troubles when having xcodeproj conflicts !

Now, the issue ; as said in the title i got an error when trying to resolve conflicts in my xcodeproj. I'm using Xcode 10.1 and xcodeproj has been created with this version of the IDE.

I think this is not a problem with the content of my Xcodeproj itself, as you can see on the image below. It is a simple conflict (that i succeed to resolve !). image

Do you think that supporting version 50 is possible ?

NicolasRiviere avatar May 29 '19 15:05 NicolasRiviere

I get the same problem, but for version 51 😞

davidavsoares avatar Jun 19 '19 19:06 davidavsoares

Hi @NicolasRiviere

Are you able to do the merge again? If so, it would be helpful to have a dump of the files that mergepbx uses as input.

You can dump them by adding --dump /tmp/mergepbx.zip to the arguments for mergepbx in your ~/.gitconfig. This will create a ZIP file under /tmp/mergepbx.zip from the files that you are trying to merge when you do the merge.

mergepbx gets three files as input: the file from the current branch, the file from the branch you are merging and the file from the merge base. The merge base is the last common commit of the branches which are merged together.

You need all those three files to determine what the merge result should be.

From your screenshot alone I can't see what caused the error, because it only shows me two files which is not enough to determine why the merge failed.

You could have a legitimate conflict if the merge base had a different file which has been replaced by DataTest.swift and Data+Extension.swift.

Example:

The current commit looks like this:

A
B

Now the branch b1 and b2 are created from this commit.

b1 now changes to

A
C

and b2 changes to

A
D

Now what should the result be, if we merge b2 into b1?

A B C D or A B D C? Which order should we take, should the changes from b1 come first or those from b2?

Or did both b1 and b2 try to replace B? Then we have to choose which replacement we should take, A D or A C?

To answer those questions, you have to ask the user for his actual intent. So a merge has to fail in this case and let the user himself decide what the correct result should be.

simonwagner avatar Jun 19 '19 20:06 simonwagner

Hello @simonwagner

Thanks for answering :) Yes, my example wasn't the best one to explain the issue we're encountering.

I tried again to do a merge with the tool ; i got the issue again. I'm joining the dumped zip. mergepbx.zip

NicolasRiviere avatar Jun 28 '19 16:06 NicolasRiviere

Hello @simonwagner

I have another one to share !

mergepbx.zip

NicolasRiviere avatar Jul 04 '19 14:07 NicolasRiviere

@NicolasRiviere Hello, I have the same issue with 51 version. Did you resolve that problem? @simonwagner

jsyrtsov avatar Mar 24 '21 08:03 jsyrtsov

I have modified SUPPORTED_OBJECT_VERSIONS = set((51,)) in pbxmerge.py and all worked well, thank for the script!

jsyrtsov avatar Mar 24 '21 08:03 jsyrtsov

I have modified SUPPORTED_OBJECT_VERSIONS = set((51,)) in pbxmerge.py and all worked well, thank for the script!

Thanks! I Will do the same!

davidavsoares avatar Mar 24 '21 10:03 davidavsoares