simonwagner / mergepbx Goto Github PK
View Code? Open in Web Editor NEWscript for merging XCode project files in git
License: GNU General Public License v3.0
script for merging XCode project files in git
License: GNU General Public License v3.0
What debug information can I get for you, I don't really know where to start with mergepbx
? ๐
The conflict was on a group that had been moved to different positions on two branches.
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 !).
Do you think that supporting version 50
is possible ?
this is such an awesome tool. we just made an tremendous amount of changes in two branches, merge worked good but had to delete a bunch of files in xcodeproj groups that were removed from the file system
since #22, if there are merge conflicts that cannot be resolved by the 3-way text merge, the conflict markers stay in the file (good), but the file gets marked as resolved (bad). the latter results in merge tools not recognizing the file as in conflict, and not being able to assist in resolving the conflicts.
When I build a file via build.py the output file is not usable:
> ./mergepbx
Traceback (most recent call last):
File "<stdin>", line 5, in <module>
ImportError: No module named mergepbx
The same problems apply to the prebuilt variant mentioned in the readme.
I'm running python 2.7.3 on OSX 10.8.
I made a simple project for checking.
I added a new file in the branch 'test1', and added a new file in the branch 'test2'.
Then I tried to merge 'test1' and 'test2', but I was warned this errors.
$ git checkout test1
Switched to branch 'test1'
$ git merge test2
merging failed: 'ascii' codec can't encode characters in position 0-1: ordinal not in range(128)
Auto-merging DummyProjectForMergepbx.xcodeproj/project.pbxproj
CONFLICT (content): Merge conflict in DummyProjectForMergepbx.xcodeproj/project.pbxproj
Automatic merge failed; fix conflicts and then commit the result.
This project include that branches is here -> https://github.com/tokorom/DummyProjectForMergepbx
and my LANG environment variable is ja_JP.UTF-8
.
$ echo $LANG
ja_JP.UTF-8
I have Python 2.7.8 installed from MacPorts and ANTLR 3.1.3 from the antlr website. I get the following error when merging.
Traceback (most recent call last):
File "<stdin>", line 6, in <module>
File "/Users/kasper/mergepbx/mergepbx.py", line 67, in main
File "/Users/kasper/mergepbx/plist/antlr/runtime/antlr3/exceptions.py", line 317, in __str__
File "/Users/kasper/mergepbx/plist/antlr/runtime/antlr3/exceptions.py", line 184, in getUnexpectedType
AttributeError: 'NoneType' object has no attribute 'type'
I can't share my project files in public.
I've just upgraded to Xcode 6 and when attempting to rebase mergepbx fails with this error:
Traceback (most recent call last):
File "<stdin>", line 6, in <module>
File "/Users/apple/bin/mergepbx/mergepbx.py", line 67, in main
File "/Users/apple/bin/mergepbx/plist/antlr/runtime/antlr3/exceptions.py", line 317, in __str__
File "/Users/apple/bin/mergepbx/plist/antlr/runtime/antlr3/exceptions.py", line 184, in getUnexpectedType
AttributeError: 'NoneType' object has no attribute 'type'
I'm not certain that Xcode 6 is the problem, but it's the only thing I can think of that has changed.
Thanks for making such a useful tool. I'm lost without it!
Hi @simonwagner,
first of all great repo, I was wondering how mergepbx handle the cases such as: my colleague added file a.swift to a group, at the same time I also added a.swift to the same group, when we merge our stuff, we will get merge conflict, same file_reference but different uuid, currently what I am seeing when I use mergepbx as merge tool is the merge conflict was resolved but in the group there are two a.swift file. I though mergepbx would only choose one of the file_reference from merge conflict.
thanks!
Whenever I have a valid Merge Conflict, e.g.
Branch A is setting the Deployment Target to 8.0
Branch B is setting the Deployment Target to 7.0
I am supposed to have a merge conflict since both branches modified the same value.
I am correctly shown a merge conflict when Rebasing Changes from Branch B onto A.
But I am not seeing the conflict in the project file. I would have expected to see something like:
<<<
Deployment Target 7.0
'===
Deployment Target 8.0
in the project file.
But it seems pbxmerge just used the value from the Branch that was merged upon.
I have used mergepbx with good results. Recently I updated to the latest version and have started getting errors like the above
merging failed: No module named antlr3.streams
Do I miss something in my Python installation?
I encountered an unmergeable project file. For some reason XCode created a few lines in the project file that looked like:
9F7A68181A24D72800A23C41 /* (null) in Sources */ = {isa = PBXBuildFile; };
Removing lines like that from the project file caused mergepbx to work perfectly again! I have no idea at all why it would be doing that, but it happened when I added a file into my project. I am using Xcode 6.1.1.
I can send you the project file dumps but I'd prefer to do this via email rather than through Github if that's ok.
Thanks again for the brilliant project!
Let me know how I can provide more detailed and helpful info
mergepbx just sits there for a while and then I get merging failed: 'fileRef'.
mbpxdump.zip
When the pbxproj has objectVersion = 47, this merge tool does not work :(
It returns with this message:
merging failed: can not merge projects with objectVersion 47 PROJECT.xcodeproj/project.pbxproj seems unchanged. Was the merge successful? [y/n]
Trying to merge a xcodeproj with any swift packages added through Xcode fails with the error
merging failed: Unknown entry in project file: XCRemoteSwiftPackageReference
I'm seeing consistent merge failures with Mozilla's Firefox for iOS Swift project at https://github.com/mozilla/firefox-ios. The error log (snippet) is below.
Merge failure would not be a huge deal except that my configuration doesn't fall back to manual; it obliterates the change entirely. (I think this is an issue with my configuration, not necessarily with mergebpx.)
A quick skim of the code suggests that the project section corresponding to the Swift "bridging header" needs to be explicitly handled, somehow, in mergepbx. I will try to figure out what needs to be done but would appreciate direction.
Applying: Bug 1141843 - Final: project changes for Sync working branch.
Using index info to reconstruct a base tree...
M Client.xcodeproj/project.pbxproj
Falling back to patching base and 3-way merge...
merging failed: strategy not found: PBXHeadersBuildPhaseMerger3
Auto-merging Client.xcodeproj/project.pbxproj
CONFLICT (content): Merge conflict in Client.xcodeproj/project.pbxproj
Failed to merge in the changes.
Patch failed at 0014 Bug 1141843 - Final: project changes for Sync working branch.
The copy of the patch that failed is found in:
/Users/nalexander/Mozilla/firefox-ios/.git/rebase-apply/patch
When you have resolved this problem, run "git rebase --continue".
If you prefer to skip this patch, run "git rebase --skip" instead.
To check out the original branch and stop rebasing, run "git rebase --abort".
๐ป
Hi,
I have mergepbx setup as a merge driver (reference in .gitconfig
and .gitattributes
) but whenever I merge two branches all it seems to do is remove references to files from the project that would result in a merge conflict leaving me to add them back by hand. That can't be the intended usage, right?
Thanks
Jan
Hi,It's a cool tool!,Thanks a lot.
I read your blog, and I wan't to use a .gitattributes file to solve the problem, but I'm worried about that if I use cocoaPods to add lib . Is there any issue in my project ?
Hi
I've installed mergepbx via brew brew install mergepbx
and tried to use it to merge a .pbxproj
file with git mergetool --tool=mergepbx something.xcodeproj/project.pbxproj
but git gives the output
Merging:
something.xcodeproj/project.pbxproj
Normal merge conflict for 'something.xcodeproj/project.pbxproj':
{local}: modified file
{remote}: modified file
Unknown merge tool mergepbx
However running mergepbx
barewords gives the expected mergepbx: error: too few arguments
along with the usage:
message. which mergepbx
reveals it is located in /usr/local/bin/mergepbx
but using the entire path for --tool=
still gives the unknown merge tool.
Adding the lines from the README to .gitattributes and .gitconfig did not change this
How do I proceed? I would have hoped brew would have informed me if there was a caveat to installing using homebrew...
The path to my project.pbxproj file contains whitespace:
Foo Project.xcodeproj/project.pbxproj
I cannot get mergepbx to work with this. My first attemt was this:
$ grep bin/mergepbx ~/.gitconfig
cmd = /usr/local/bin/mergepbx -o "$MERGED" "$BASE" "$LOCAL" "$REMOTE"
$ git mergetool --tool=mergepbx
Merging:
Foo Project.xcodeproj/project.pbxproj
[..]
usage: mergepbx [-h] [-o OUTPUT] [-d] [--dump DUMP] [--clean] [--no-clean]
base mine theirs
mergepbx: error: unrecognized arguments: ./Foo Project.xcodeproj/project_LOCAL_42551.pbxproj ./Foo Project.xcodeproj/project_REMOTE_42551.pbxproj
The errormessage makes me assume that "./Foo" gets assigned to output, " Project.xcodeproj/project.pbxproj" to base, "./Foo" to mine and "Project.xcodeproj/project_BASE_42551.pbxproj" to theirs, as if the spaces are incorrectly treated as argument separators.
The same .gitconfig line works perfectly fine for p4merge or kdiff3. I also tried various combinations of escaping and extra quotes, but all of the following give the exact same result:
cmd = /usr/local/bin/mergepbx -o \"$MERGED\" \"$BASE\" \"$LOCAL\" \"$REMOTE\"
cmd = /usr/local/bin/mergepbx -o "\"$MERGED\"" "\"$BASE\"" "\"$LOCAL\"" "\"$REMOTE\""
cmd = /usr/local/bin/mergepbx -o \\\"$MERGED\\\" \\\"$BASE\\\" \\\"$LOCAL\\\" \\\"$REMOTE\\\"
cmd = /usr/local/bin/mergepbx -o "\\\"$MERGED\\\"" "\\\"$BASE\\\"" "\\\"$LOCAL\\\"" "\\\"$REMOTE\\\""
It seems I'm running into a crash with the latest version of mergepbx. My Xcode project is from the latest 8.3.1.
Traceback (most recent call last):
File "<string>", line 5, in <module>
File "/Users/jacob/Downloads/mergepbx-master/mergepbx/mergepbx.py", line 78, in main
merge_pbx_files(args.base, args.mine, args.theirs, output, clean=args.clean)
File "/Users/jacob/Downloads/mergepbx-master/mergepbx/mergepbx.py", line 102, in merge_pbx_files
merged_project = merge_pbxs(base, mine, theirs)
File "/Users/jacob/Downloads/mergepbx-master/mergepbx/pbxproj/merge/__init__.py", line 8, in merge_pbxs
return merger.merge(base, mine, theirs)
File "/Users/jacob/Downloads/mergepbx-master/mergepbx/pbxproj/merge/pbxmerge.py", line 146, in merge
self.merge_objects(result, base, mine, theirs)
File "/Users/jacob/Downloads/mergepbx-master/mergepbx/pbxproj/merge/pbxmerge.py", line 204, in merge_objects
merged_obj = merger.merge(base_obj, mine_obj, theirs_obj)
File "/Users/jacob/Downloads/mergepbx-master/mergepbx/pbxproj/merge/pbxmerge.py", line 72, in merge
result = self.handle_conflicts(base, mine, theirs, diff3)
File "/Users/jacob/Downloads/mergepbx-master/mergepbx/pbxproj/merge/pbxmerge.py", line 93, in handle_conflicts
raise MergeConflictException("conflict while merging with %s merger" % self.__class__.__name__)
MergeConflictException: conflict while merging with XCVersionGroupMerger3 merger
I'm not sure what key or section of my project it's getting held up on as there's no logging for that sort of thing. Do you have any suggestions on how to go about debugging this?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.