Allow git to merge pbxproj files

Summary:
Follow on in https://github.com/facebook/react-native/pull/10864.

**Motivation**

ncuillery Is has a lot of experience with upgrading RN projects (see his [talk](http://www.slideshare.net/ncuillery/introducing-the-new-reactnative-upgrade)) and is rewriting 'react-native upgrade' to use git.

He tells me that we actually want git to merge changes in the .pbxproj file. In his words: "Making the project.pbxproj invisible for "git diff" means that react-native-git-upgrade will never be able to upgrade the project.pbxproj."

Note the git docs explicitly recommend not to use git to merge .pbxproj files: https://git-scm.com/book/en/v2/Customizing-Git-Git-Attributes#Binary-Files

ncuillery do we have an alternative? Some ideas:

1. Use a 3rd-party tool in 'react-native upgrade' to merge the .pbxproj file?
2. We could always re-generate and overwrite the .pbxproj file (never merge) and then run 'react-native link' to update native 3rd-party dependencies in the Xcode project?
3. Last resort: stay away
Closes https://github.com/facebook/react-native/pull/11047

Differential Revision: D4220521

fbshipit-source-id: 823c735856b519be114aa4349ca1392910f00445
This commit is contained in:
Martin Konicek 2016-11-22 17:48:12 -08:00 committed by Facebook Github Bot
parent c455c2bcc6
commit 3aa25f7917
3 changed files with 2 additions and 1 deletions

View File

@ -77,6 +77,7 @@ function dotFilePath(path) {
if (!path) return path;
return path
.replace('_gitignore', '.gitignore')
.replace('_gitattributes', '.gitattributes')
.replace('_babelrc', '.babelrc')
.replace('_flowconfig', '.flowconfig')
.replace('_buckconfig', '.buckconfig')

View File

@ -1 +0,0 @@
*.pbxproj binary

View File

@ -0,0 +1 @@
*.pbxproj -text