Skip to content

Commit

Permalink
Remove the line from .gitattributes that treats pbxproj files as bina…
Browse files Browse the repository at this point in the history
…ry (#1561)

Summary:
Pull Request resolved: #1561

The "*.pbxproj binary merge=union" line was added in a prior commit (D18655686 (c54b37a)) as a way to automatically resolve merge conflicts in Xcode project files based on this article: https://thoughtbot.com/blog/xcode-and-git-bridging-the-gap

The article doesn't specify why the pbxproj file should be treated as a binary, however one side effect is that the `git diff` command will no longer show changes in the project file.

For example if a project file is changed it will just show the following:
```
Binary files a/FBSDKGamingServicesKit/FBSDKGamingServicesKit.xcodeproj/project.pbxproj and b/FBSDKGamingServicesKit/FBSDKGamingServicesKit.xcodeproj/project.pbxproj differ
```

It doesn't seem like the binary attribute is necessary to use the merge=union strategy as the following article
https://roadfiresoftware.com/2015/09/automatically-resolving-git-merge-conflicts-in-xcodes-project-pbxproj/

However I'm not convinced that we need the merge=union strategy since resolving conflicts in project files is fairly simple and mostly only occurs when two files have been added in the same location in the project. Even then the conflict is easy to resolve.

Furthermore it doesn't look like this strategy works reliably. This StackOverflow answer indicates that the user tried this strategy and ended up removing it since it didn't work in about 1 of 4 cases: https://stackoverflow.com/a/18275082. (When it doesn't work it will prevent the project from being opened at all and would have to fixed manually anyway).

And finally, if there is a conflict between two similarly named files that have been added to the location in the project file, resolving the conflict manually allows the alphabetical order of the files to be corrected if needed.

Reviewed By: joesus

Differential Revision: D24762186

fbshipit-source-id: 5454843d193f401f9b95c31898ad1e58a4c1a03e
  • Loading branch information
jawwad authored and facebook-github-bot committed Nov 5, 2020
1 parent c28e3c5 commit 508983d
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
*.strings diff=localizablestrings
*.pbxproj binary merge=union

0 comments on commit 508983d

Please sign in to comment.