New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[iOS] Make .pbxproj file a non-binary #8507
Conversation
.gitattributes
Outdated
@@ -1,4 +1,4 @@ | |||
*.pbxproj -diff linguist-generated | |||
*.pbxproj text -merge union linguist-generated |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this something we would like to try?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think James mentioned that we might want to keep Pods' pbxproj as it was (because it's generated) and change git attributes only for this one under ios/Exponent.xcodeproj
.gitattributes
Outdated
@@ -1,3 +1,4 @@ | |||
ios/Exponent.xcodeproj/project.pbxproj merge=mergepbx -text linguist-generated |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, still, what about other project.pbxproj? Especially from Pods folder, in the client and bare-expo as well.
d7a5843
to
297e5a2
Compare
7d840fc
to
04cc243
Compare
04cc243
to
9de628f
Compare
.gitattributes
Outdated
*.pbxproj binary linguist-generated | ||
ios/Exponent.xcodeproj/project.pbxproj merge=mergepbx -text diff linguist-generated | ||
apps/bare-expo/ios/BareExpo.xcodeproj/project.pbxproj merge=mergepbx -text diff linguist-generated |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These lines result in being able to see diff for only two specified .pbxproj
files (every else .pbxproj
is treated as binary
(-diff -text
):
diff --git a/apps/bare-expo/ios/BareExpo.xcodeproj/project.pbxproj b/apps/bare-expo/ios/BareExpo.xcodeproj/project.pbxproj
index af29fdbeed..664369f871 100644
--- a/apps/bare-expo/ios/BareExpo.xcodeproj/project.pbxproj
+++ b/apps/bare-expo/ios/BareExpo.xcodeproj/project.pbxproj
@@ -6,8 +6,6 @@
objectVersion = 46;
objects = {
-
-
/* Begin PBXBuildFile section */
00E356F31AD99517003FC87E /* BareExpoTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 00E356F21AD99517003FC87E /* BareExpoTests.m */; };
13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.m */; };
diff --git a/apps/bare-expo/ios/Pods/Pods.xcodeproj/project.pbxproj b/apps/bare-expo/ios/Pods/Pods.xcodeproj/project.pbxproj
index 85e3e54d20..1d3bbf20b5 100644
Binary files a/apps/bare-expo/ios/Pods/Pods.xcodeproj/project.pbxproj and b/apps/bare-expo/ios/Pods/Pods.xcodeproj/project.pbxproj differ
diff --git a/ios/Exponent.xcodeproj/project.pbxproj b/ios/Exponent.xcodeproj/project.pbxproj
index 5b42fb5434..bc57b61db4 100644
--- a/ios/Exponent.xcodeproj/project.pbxproj
+++ b/ios/Exponent.xcodeproj/project.pbxproj
@@ -1,6 +1,8 @@
// !$*UTF8*$!
{
archiveVersion = 1;
+
+
classes = {
};
objectVersion = 46;
.gitattributes
Outdated
@@ -1,4 +1,6 @@ | |||
*.pbxproj -diff linguist-generated | |||
*.pbxproj binary linguist-generated | |||
ios/Exponent.xcodeproj/project.pbxproj merge=mergepbx -text diff linguist-generated |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for applying my suggestion! I've inspected the mergepbx
library and started to wonder if… this will work automatically? The setup on https://github.com/simonwagner/mergepbx#using-mergepbx-as-a-merge-driver suggests to also edit ~/.gitconfig
— I don't suppose we'd want to make all the contributors have to modify it manually? Or is it somehow automatically taken care of?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, after a second thought I think I'm going to remove it.
Why?
- You have to have it installed to be available
- Even though it probably might come in handy (I believe every
pod install
modifies whole.pbxproj
file and especially UUIDs are generated from scratch) andunion
merge would possibly fail miserably in almost every case, I don't think we need sth like this and I haven't tested it so ¯_(ツ)_/¯
@@ -1,4 +1,6 @@ | |||
*.pbxproj -diff linguist-generated | |||
*.pbxproj binary linguist-generated |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does making pbxproj
a binary also hide it from the diff? Is it still possible to expand the diff to see the changes?
IMHO we would like to hide it from the diff 👍, but I would also like to see the changes if I want to. What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sjchmiela, yeap, marking file as binary
disables diff
and CRLF
conversion, but from what I've experienced only in git
tool. That means neither git show
nor git diff
would show file content. I believed that this would cause github
to show this kind of files (with binary
attribute) to be shown as binary file
in PRs and previews as well, but it turned out that github
is not working like this 🤔 So, if you navigate to https://github.com/expo/expo/pull/8508/files you'll see that all .pbxproj
files contents are perfectly visible if you expand the diff 🤔 Maybe I'm missing sth somewhere, but I dunno where and what 🤷
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That sounds great! 🥇
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for thinking it over! 🧠
@@ -1,4 +1,6 @@ | |||
*.pbxproj -diff linguist-generated | |||
*.pbxproj binary linguist-generated |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That sounds great! 🥇
Why
https://exponent-internal.slack.com/archives/C1QLJDKDZ/p1590273938117300
Check the change here: https://github.com/expo/expo/pull/8508/files