My goal is to use git bisect. I'm being stymied by the fact that, apparently close to the commit that introduced the problem I am trying to correct, I introduced another minor error that renders a number of neighbor commits untestable.
This second error was a trivial mistake. I corrected it several commits later.
What I would like to do is this:
git checkout master
git checkout -b fully-testable-branch
git rebase -i initial-good-bisect-point
and then the remove the commit that introduced the second error from the list of commits. I expect and am prepared to deal with a few conflicts in the area of code and of history.
Then, if all goes well (and it should -- most of the commits in this project are testable) I could bisect again, this time between the tip of the fully-testable-branch and initial-good-bisect-point, find and study the problem commit, checkout master, and go from there.
This would work fine if history were linear. (I've done it before.) What git rebase -i does, however, is linearize non-linear history. This, in turn, creates many conflicts that have already been resolved (often not by me, often by me on other machines, so my rerere cache isn't much help). These conflicts are in parts of my program related to neither the error I'm trying to nail down nor to the minor one I have identified.
I'm not thrilled about having to resolve these conflicts all over again. This work was tedious and error-prone enough the first time!
So, is there a way to make git rebase -i replay history including branches and merges? Is there another command that will? Am I going about this all wrong, and, if so, what should I try instead?
Edit: Per request, here's a simplified version of history.
A-B-C-D-E--F-G-H-I-J-R-S-T
\ /
\ /
α-N-M---P---
\ /
β /
\ /
γ
There were conflicts that were resolved at P, and the minor error was created at D. This history is flattened into:
A-B'-C'-D'-E'-F'-α'-β'-γ'-N'-M'-P'-F'-G'-H'-I'-J'-Z'
When replaying history thus, there are conflicts at N', M', and P'.