Should I merge .pbxproj files with git using merge = union?

I am wondering if the merge = union parameter in .gitattributes makes sense for .pbxproj files.

The manpage position for this option:

Run a three-way file level alignment for text files, but take lines from both versions instead of leaving conflict markers. This tends to leave the added lines in the resulting file in random order, and the user should check the result.

As a rule, this should be good for 90% of cases when adding files to a project. Does anyone have any experience with this?

+17
git merge objective-c cocoa
Apr 28 '10 at 11:50
source share
2 answers

Not direct experience, but:

  • This SO> question really advises merging .pbxproj files .pbxproj .

The pbxproj file is not really human- pbxproj .
Although this is plain ASCII text, it is a form Json . Essentially, you want to treat it as a binary.

(hence gitignore solution )

Actually, Peter Hosey adds to the comment:

This is a list of properties , not JSON. The same ideas, different syntax.

  • However, according to this question :

The truth is that it is more dangerous to refuse to merge this .pbxproj file than it is useful.
The .pbxproj file is just json (similar to XML). From experience, just about the only merge conflict that you have ever received is if two people added files at the same time. The solution in 99% of cases of a merger conflict is to preserve both sides of the merger.

So, the union of "union" (with the gitattributes merge directive) makes sense, but do some testing to see if it does the same thing as the script mentioned in the last question.

+17
Apr 28 '10 at 13:08
source share

Recently, I have been working with a large team and tried *.pbxproj merge=union , but in the end I had to remove it.

The problem was that the brackets became inappropriate on a regular basis, which made the files unreadable. It is true that it works most of the time - but cannot be 1 out of 4 times.

We will return to using *.pbxproj -crlf -merge . This is perhaps the best solution for us.

+7
Aug 16 '13 at 13:57 on
source share



All Articles