git bisect first guess outside of bounds

206 views Asked by At

I am trying to use git bisect

I identified the bad commit to be:

2ac4ac0a46d902235a51216b24257a977877979a at 19 Oct 2016

The first good commit that I found is:

6a1d1ec5599d011a75df18075feb1819f1ad8877 at 9 Jan 2016

So i run:

> git bisect start
> git bisect good 6a1d1ec5599d011a75df18075feb1819f1ad8877 
> git bisect bad 2ac4ac0a46d902235a51216b24257a977877979a
Bisecting: 3639 revisions left to test after this (roughly 12 steps)
[51450765b77e07b853b7efd0799aaeb2fbb5a0ea] only show canvas-player controls when not playing && controls = true

Now the issue is that the first guess that the bisect tool made is:

51450765b77e07b853b7efd0799aaeb2fbb5a0ea at 21 May 2015

Which is outside of the initial 2 commit dates. How can this be?

2

There are 2 answers

0
LeGEC On

git bisect uses the "parent" relation between commits, not their dates.

With actions such as git commit --amend, git rebase or git cherry-pick, you can create sequences of commits where the dates do not match the sequence of commits.


You can check on a graphical tool if 51450765b77 lies between 6a1d1ec and 2ac4ac0, or in a terminal using git log --graph --oneline :

git log --graph --oneline [firstgoodcommit]..[badcommit]
0
AnimiVulpis On

A possibility, assuming something like the following:

* d4349a4 (master, HEAD) Commit 10
* 9816794 (broken) Commit 9
* abaf79f Commit 8
*   e76f38f Merge branch 'branch1'
|\
| * e897f8e (branch1) Branch 5
| * d8b71a8 Branch 4
| * 1832b61 Branch 3
| * a821494 (working) Branch 2
| * 12c87e1 Branch 1
* | 2b94daa Commit 7
* | 515bea5 Commit 6
* | 516af15 Commit 5
* | 5a33f68 Commit 4
* | 66c18bc Commit 3
|/
* 7d10cd8 Commit 2
* 71bc62e Commit 1

If you run git bisect broken working and then git bisect visualize --oneline (To see the currently remaining suspects) you will see something like:

9816794 (broken, refs/bisect/bad) Commit 9
abaf79f Commit 8
e76f38f Merge branch 'branch1'
e897f8e (branch1) Branch 5
d8b71a8 Branch 4
1832b61 Branch 3
2b94daa (HEAD) Commit 7
515bea5 Commit 6
516af15 Commit 5
5a33f68 Commit 4
66c18bc Commit 3

The reason why commits from the master branch are included is, that those could have introduced the error too.