git diff is great but kinda sucks when reporting about deep keys updates in JSON files, because it only shows the last key, and not the whole object path to the updated key
$ git diff HEAD~1 -- file.json ... - "name": "John Doe" + "firstName": "John", + "lastName": "Doe" ...
But by combining
git show $rev:$path, we can have a very pretty output that tells which keys have been updated, and it's almost valid JS!
$ diff <(git show HEAD~1:file.json | gron) <(gron file.json) < json.users.owner.name = "John Doe"; --- > json.users.owner.firstName = "John"; > json.users.owner.lastName = "Doe";
I found that too elegant not to share. Have fun scripting!