1

I'm trying to track a diff within the assets.xcassets file in Xcode but I can't find a way to do a git blame.

Steve Moser
  • 7,647
  • 5
  • 55
  • 94
  • Blame is for lines of code. The assets constitute a directory. What's the actual problem you are trying to solve? – matt Sep 11 '17 at 17:31
  • @matt Is there anyway to see the changes to the assets like from the contents.json file from within Xcode like you can with storyboard files by right clicking on them and selecting Open As ... ? – Steve Moser Sep 11 '17 at 21:11
  • Maybe not from within Xcode, but there would be no problem in SourceTree or the Terminal. – matt Sep 11 '17 at 23:54

1 Answers1

1

It's easy to do a diff in Terminal:

humlet:Assets.xcassets matt$ git diff 0e010a 6d516c -- Image.imageset/Contents.json
diff --git a/Testing/Assets.xcassets/Image.imageset/Contents.json b/Testing/Assets.xcassets/Image.imageset/Contents.json
index 6376a19..5804661 100644
--- a/Testing/Assets.xcassets/Image.imageset/Contents.json
+++ b/Testing/Assets.xcassets/Image.imageset/Contents.json
@@ -1,17 +1,30 @@
 {
   "images" : [
     {
-      "idiom" : "universal",
-      "filename" : "me.jpg",
+      "idiom" : "iphone",
       "scale" : "1x"
     },
     {
-      "idiom" : "universal",
+      "idiom" : "iphone",
       "scale" : "2x"
     },
     {
-      "idiom" : "universal",
+      "idiom" : "iphone",
       "scale" : "3x"
+    },
+    {
+      "idiom" : "ipad",
+      "scale" : "1x"
+    },
+    {
+      "idiom" : "ipad",
+      "scale" : "2x"
+    },
+    {
+      "idiom" : "universal",
+      "filename" : "me.jpg",
+      "unassigned" : true,
+      "scale" : "1x"
     }
   ],
   "info" : {

As you can see, what happened between these two commits is that I removed the "universal" display of slots and displayed "iPhone" and "iPad" slots instead.

matt
  • 515,959
  • 87
  • 875
  • 1,141