I have the following problem:
Okay. Let's ask our friend git bisect
for the revision that fixed the bug:
git bisect start
git bisect bad last
git bisect good master
But that's not going to work:
Some good revs are not ancestor of the bad rev. git bisect cannot work properly in this case. Maybe you mistake good and bad revs?
How can I overcome this? Did I miss something in the documentation?
As of Git 2.7, you can use the arguments --term-old
and --term-new
.
For instance, you can identify a problem-fixing commit thus:
git bisect start --term-new=fixed --term-old=unfixed
git bisect fixed master
git bisect unfixed $some-old-sha1
As you test, say git bisect fixed
or git bisect unfixed
as appropriate.
Instead of temporarily training yourself to think that bad means good and good means bad, why not create some aliases?
In file ~/.gitconfig, add the following:
[alias]
bisect-fixed = bisect bad
bisect-unfixed = bisect good
You can start identifying a problem-fixing commit thus:
git bisect start
git bisect-fixed master
git bisect-unfixed $some-old-sha1
As you test, say git bisect-fixed
or git bisect-unfixed
as appropriate.