I have the following issue:
I have many commits that need to be squashed (several thousand, we had a runaway script). Those commits are in groups between 40 to 200.
Using git rebase -i
is not feasible since it would involve too much labor.
We have a tool, that can output the first and last commit of such a group relative from the branch HEAD (which can be used to get the actual commit by its reference hash).
So as an example I'm looking for something that can squash HEAD~400 to HEAD~200 into a single commit. And can then be run again (with change arguments) to squash HEAD~100 to HEAD~50 into another single commit.
Edit 1:
I have thought about about creating a "fake" editor, that essentially fakes the interactiveness, by performing the changes to the rebase file. An abstract example script would look like this (which I could loop until all groups have been squashed):
start=$('get start of oldest group')
end=$('get end of oldest group')
git config core.editor "'~/fakeeditor' -start $start -end $end"
git rebase -i