Creating Xcode projects with Projucer - Source Control Doesn't Show Modified Files


#1

If I create a project in Xcode and use source control, after a commit, any modifications to files causes the normal “M” to appear next to the source file.

If I create a project with the Projucer, say a GUI application, then use source control in Xcode, modifications to files don’t cause the files to show the “M” in front of them. They act as if they haven’t been modified.

Anyone with similar experience? Any fixes?


#2

Could you provide a screenshot? :slight_smile:

We have GIT based source-control after creating initial JUCE project and it works as expected.
Our repos are being pushed and pulled from all sort of OSes and it seems to be working fine.


#3

In the first photo, I’m creating a working copy, in the second photo, I’ve changed some code (just deleted some of the line) and saved the file. This should induce the “M” to appear, but its not on my end.

Mac OS 10.12.2, Xcode 8.2, Newest Projucer I think.


#4


#5

I’m not sure this is how version control is working.
To be honest I do all git from terminal.

However, I think you’re missing some steps.
Read this - http://stackoverflow.com/questions/5301572/how-can-i-add-an-existing-project-as-a-working-copy-in-xcode-4

Sidenote,
As I’ve been taught by the senior devs here,
try avoiding any generated files in your repo.
If you’re going JUCE you should ignore Build folder (look at the JUCE .gitignore(s) ) since Projucer / Jucer are your project while Xcode and other targets are generated files…


#6

Followed these instructions exactly:

"The key for me was quitting Xcode then following Apple’s instructions exactly. In Terminal:

cd project_folder # project containing the .xcodeproj file git init
git add . # note the dot after "add" git commit -m 'Initial version text’
Then get back into Xcode, open the Organizer, et voilà — instant repository"

Still no "M’s next to modified files. If you dont mind me asking ttg, what OS version, JUCE version, and Xcode version do you run? Maybe this is an incompatibility with newer combinations?


#7

Siera 10.12.2 / JUCE (we’re pretty much on JUCE 4.3 / latest development).
Xcode 8.2 (8C38)

When you modify a file and do “git status” do you see the modified files?


#8

Note that if you undo your change and save again, the “M” will vanish. The source control doesn’t care about modification times, only the content counts.

Sometimes it takes a couple of seconds for the “M” to appear.

Another thing to check if there are modifications is on the right side there is the “diff” mode:

It shows a side by side diff to your checked in version.
…works here on 10.10.5 and XCode 7.2.1…


#9

@ttg - I’ll try your suggestion when I get home. Thank you.

@daniel - Thank you, I am aware of this. Many times I see a file has changed that I must’ve accidentally added a keystroke or backspaced one and I just undo the operation and save it, the M disappears shortly after.

I’ll check the diff mode though, thanks for that suggestion.


#10

@ttg - the file I modify does not show up when I use the Terminal command “git status”
@daniel - When going into split view (Diff view), nothing is shown as being modified, even if I clearly modified it.

Also, making a first commit, then changing a bunch of text in different files, saving them, and running “discard all changes” in the source control menu does NOTHING. I’m pretty familiar with source control in Xcode and have never had trouble with it until I created an app with the Projucer.


#11

Also, version control SEEMS to be working for the *.xcodeproj file. It only seems to not be working for files that are in the JUCE-created “source” folder, which is separated from from the *.xcodeproj file and where they normally would be if the project was created by Xcode. It almost seems like source control isn’t able to see the files.


#12

so where is your .git folder? (ls -la)
could it be, that you accidently only added the Builds folder?

This is actually wrong, because the repository will only contain the project file.
use the folder where the .jucer file is (not the .xcodeproj file). This way the Source folder will be also under source control…


#13

This seems like it will be the solution. Facepalm

I’ll confirm when I get home from work.

Ive never had to do anything extra outside of use Xcode to make the .git folder, but it makes total sense since Xcode can’t understand the folder hierarchy created by JUCE. I feel entirely silly now. I think ttg was also trying to get me to see this, but I must’ve not understood it. I’m new to JUCE and new to having to do extra steps to have my IDE recognize files outside of the default placement. Many thanks for the great help, what a nice community. I’ll respond after I try. I’ll delete the old .git and add the new one, up one parent directory.


#14

@daniel - thank you so much for the help. You were correct. I had the git repo in the wrong place. I’ve only been developing for 2 years now and have never used an app that created the folder hierarchy outside of Xcode, so I’ve never had to manually place it anywhere else besides where Xcode placed it. Thank you very much for the help.

I used Terminal to trash the old git and made a new one in the correct spot, now I’m curious if theres a way to tell Xcode a custom path for git in the future. I dont plan to always use JUCE to start my projects, but for the occasions I do, it would be nice if there was a way to change the git location in Xcode.