2

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.

zbeekman
  • 648
  • 7
  • 15

1 Answers1

1

BFG doesn't currently support running arbitrary commands on commits, trees or blobs it encounters. There are a couple of PRs and issues that request this, notably #169 and #165, so you may be able to fashion something from those efforts, or collaborate there.

javabrett
  • 7,020
  • 4
  • 51
  • 73