I have a minimized JSON file in my git tree. It is a bunch of data on a single line, without spaces.
Diffs for this file are not very useful, any change in the data, of course, results in the whole line being changed.
I'd like to be able to optionally tell git to diff not the file itself, but output of a pretty-printer (like python -mjson.tool
or jq .
) for that file.
Right now I'm using this command:
diff -u <(git show HEAD:file.json | jq .) <(jq . < file.json)
What is the proper way to do this?