I did a git bisect and got the result
Bisecting: a merge base must be tested [bbdaf1111eea5365c0c94d6045d6263aab718925] Fix display bug with main-stage
How can I proceed?
git bisect help. This command uses a binary search algorithm to find which commit in your project's history introduced a bug. You use it by first telling it a "bad" commit that is known to contain the bug, and a "good" commit that is known to be before the bug was introduced.
Use git log to check the previous commits. Use Git Bisect to find the commit in which line 2 is changed from 'b = 20' to 'b = 0.00000'. Remove the bad commit by using Git Revert. Leave the commit message as is.
To do this first run git bisect reset , this will end your bisect session. Now you can start over by running git bisect start and then marking a good and bad commit, which then will start the iterative process of marking commits selected by bisect good or bad again.
The git bisect command is a fantastic tool that can help you determine which commit introduced the bug. A regression bug is a specific type of software bug that prevents a feature or software from working when it was working before the bug was introduced. Just remember, git bisect won't "fix" the broken commit for you.
This will happen if the given good and bad revision are not direct descendants of each other.
Let's assume a repository like this (using exemplary names for the commits):
* dffa2 good-commit * b38f4 a2 * cc19f a1 | * d1f17 bad-commit | * fbd1f b2 | * f66cc b1 |/ * 09f66 merge-base-commit
As the message uses the term "merge base", it might be helpful to understand that term to understand the message. A "merge base" of two or more commits is the latest commit which is a parent of all of those commits.
Therefore if those commits would be merged, all changes between the "merge base" and those commits will be merged together. Every commit which is a parent of "merge base" is not relevant to the merge, it already is a parent of all involved commits.
The described message will happen in a case like this:
$ git bisect start $ git bisect good good-commit $ git bisect bad bad-commit Bisecting: a merge base must be tested [09f66] merge-base-commit
What bisecting does is to find the commit which introduced a problem (leading to a bad
state), which in this case could lead to a problem:
good-commit
and bad-commit
Assume that the error existed in merge-base-commit. In this case it will not be possible to find the commit that introduced the bug in the difference between good-commit and bad-commit. Instead one of the commits a1
, a2
and good-commit
solves the problem, which is exactly what will happen if you decide the merge base to be bad:
$ git bisect bad The merge base merge-base-commit is bad. This means the bug has been fixed between 09f66 and [dffa2].
merge-base-commit
and bad-commit
On the other hand if the merge base is good, the problem was introduced in b1
, b2
or bad-commit
. bisect
will then continue between merge-base-commit
and bad-commit
, picking the commit in the middle between those commits and testing if that one is good:
$ git bisect good Bisecting: 0 revisions left to test after this (roughly 1 step) [fbd1f] b2
Let it run, it's normal if there are merges on the path that has to be bisected.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With