

xUnique – Regenerate Xcode projects on any machine - seganw
https://github.com/truebit/xUnique

======
andymoe
Nice, however there is a much simpler solution that works for 99% of cases.
[1]

Add a .gitattributes file to the root of your project with the following line:

*.pbxproj binary merge=union

Very occasionally you will get duplicate items but Xcode then warns you can
take approbate action.

[1] I started using this approach a couple years ago after finding this:

[http://stackoverflow.com/questions/12909222/tell-git-to-
trea...](http://stackoverflow.com/questions/12909222/tell-git-to-treat-
pbxproj-as-text)

~~~
seganw
I did not use this before, but how Git would treat if people commit in the
same files(PBXFileReference) but with different UUIDs?

xUnique makes these UUIDS unique for everyone in the project. So there should
be no conflicts theoretically.

~~~
andymoe
Like I said, there are edge cases but I've been using this with teams for a
few years and I hardly ever have to fix the project file.

------
RyanZAG
If only Apple could just implement this simple fix in xcode itself...

------
ef4
This is a nice band-aid. But really this problem is a symptom of Xcode putting
way too much redundant information in this file in the first place. It's
configuration over convention.

You could eliminate _all_ the file references if you simply codified some
conventions on project directory structure. Conventions that people are almost
certainly following anyway.

~~~
seganw
Sorry, @ef4, my English is not very good, I do not quite understand "You could
eliminate all the file references if you simply codified some conventions on
project directory structure", could you please explain a little bit?

I think the merge conflicts are all due to Xcode not using real directories on
disk, which means it has to maintain the directory structures in project file.

~~~
ef4
I think we're agreeing.

I was suggesting that Xcode should use real directories on disk.

~~~
ibisum
Personally I agree with your statement, there is a lot about the build
structure that can just be held standardly on already-working systems .. its
nice to have for example, the known debian/ tree structures, etc. 'make
dirs'/&etc.

Seems, though, that we humans are infinitely packaging things, at least in the
OS space. There are a nearly insurmountable number of ways of setting
something up so the computer can execute something for us. Tree-structures,
package formats, .desktop files, and all of these things .. its an infinite
taxonomy.

Personally, I yearn for a very smart OS which boots straight to console, and
yet then implements everything - everything, desktop, games, etc. - in a
single language context. In a lab full of beagleboards and arduinos and so on,
the desire is to reduce the language-load on the smaller machines. I think
that a single-language, wide-open, for these platforms would make for a new OS
opportunity.

Not much of a jump from booting a working kernel+load81 "./main.lua" to a new
directory structure to follow. :)

------
paragarora
Agree with Ryan. Repo Management in XCode would make sense only if this
feature was there.

~~~
seganw
Yep, Apple should have take out more brilliant idea to solve it thoroughly. At
present, I think my solution is the best one;)

