I want to squash images using tools like imageoptim-cli on MacOS from git history to shrink repo size. Can BFG support running some more arbitrary commands? My git filter-branch
looked something like this: https://gist.github.com/zbeekman/7482ccd0e87f495387951bd612dc390e
git filter-branch --prune-empty --tree-filter 'pwd ; ls -a ; imageoptim -a -q --verbose -d <path/to/img/dir/here> || true' -- --all
But this ran the image tools on those files every commit, even after they had been introduced.