I did something similar a couple years ago. I needed to rewrite an entire repo's history so that I could reformat all the code _and_ modernize all the JS syntax throughout every commit in the repo's history (dating back to 2013).<p>I started with `filter-branch`, but found it way too slow (especially on a corporate-controlled Windows machine, where starting up additional processes seems to have a lot of overhead). I concluded that I needed to run the entire filtering logic in a single process to avoid that overhead. Started writing my own with `pygit2`, but then found a repo called `pylter-branch` which did most of that same "loop through commits and reprocess" work for me - I just had to add a lot of additional logic on top for the specific reprocessing I wanted to do.<p>Ended up being able to reprocess about 15K commits in around 4.5 hours. Given the amount of processing I was doing, that was pretty good.<p>I did an extensive writeup [1] on the problem statement, investigation, and techniques I used if anyone's interested.<p>[0] <a href="https://github.com/sergelevin/pylter-branch" rel="nofollow">https://github.com/sergelevin/pylter-branch</a><p>[1] <a href="https://blog.isquaredsoftware.com/2018/11/git-js-history-rewriting/" rel="nofollow">https://blog.isquaredsoftware.com/2018/11/git-js-history-rew...</a>