$ perl -pe ‘s/\s//g’ tcm_creator.py> new
$ git checkout some-commit tcm_creator.py
$ perl -pe ‘s/\s//g’ tcm_creator.py> old
$ diff old new # should show no discrepancy
This worked for me. Entire file is flattened to a single long string.
IIF the whitespace change is only and always confined with a line i.e. no line splitting/joining , then perl -l -pe is more useful.