I have a series of git commits that, due to different editor defaults, ended up with huge whitespace diffs around every line that I ever touched. This makes git merges significantly harder, and violate the coding standards of the project I want to eventually upstream the changes to.
It's too many to fix manually, so I wanted to use unexpand
.
However, I cannot just get a list of all the changed files in every commit and run unexpand on them, as some contain embedded tabs and I also cannot make whitespace modifications to lines I do not modify.
But, I also cannot run unexpand
on the new files I add in the commits, as that would disrupt git history (long story).
So, what command/script should I use to run unexpand on all modified lines (but not touch added files) on a series of git commits?