Xcode aggressively adds asset catalog Contents.json to the Git index

Originator:douglashill
Number:rdar://33565186 Date Originated:27-Jul-2017 12:50 pm
Status:Open Resolved:
Product:Developer Tools Product Version:9.0 beta 4 (9M189t)
Classification:UI/Usability Reproducible:Sometimes
 
Summary:
Xcode aggressively adds asset catalog Contents.json to the Git index, even when add and remove files automatically is unchecked in Xcode’s source control preferences.

Steps to Reproduce:
In Xcode preferences > Source Control turn on Enable Source Control but turn off Add and remove files automatically.

1. Create a new iOS project in Xcode 8 with the single view template and commit the result into a Git repository, or see the attached folder which does exactly this.
2. Open the Xcode project in Xcode 9
3. Navigate to the asset catalogue
4. (Optional) navigate away from the asset catalogue (this just demonstrates that the monitoring is continuous)
5. Run `git status`
6. Run `git reset —hard`
7. After a short delay (less than 1s so pretty much straight away) run `git status`

Those last two steps can be repeated many times.

Expected Results:
• Git index should not be modified by Xcode since I set it not to.
• Xcode should not repeatedly modify the file.
• It would be nice if Xcode didn’t ever modify the file on its own, but I wouldn’t be too bothered if it did this a single time in response to user action, and I can see there is some need to do this.

Actual Results:
At 5 there is a modification of Contents.json in the asset catalogue adding some new entries and this is added to the Git index. At 7, the same is the case.

• Modifying the file once on opening the asset catalogue would be not ideal, but whatever.
• Repeatedly modifying the file (even when viewing some other file in Xcode) is bad. It puts me in a bad mood by telling me I’m not in control.
• Modifying the Git index when Xcode is set not to do this is bad. I make carefully make logically separated commits, then Xcode comes and tries to shove stuff in wherever.

Version:
9.0 beta 4 (9M189t)

Notes:
At one point this stopped happening until I navigated to the asset catalogue again.

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!