The command takes various subcommands, and different options
depending on the subcommand:
The command takes various subcommands, and different options depending
on the subcommand:
git bisect start [<paths>...]
git bisect bad <rev>
@ -22,30 +22,34 @@ depending on the subcommand:
@@ -22,30 +22,34 @@ depending on the subcommand:
git bisect visualize
git bisect replay <logfile>
git bisect log
git bisect run <cmd>...
This command uses 'git-rev-list --bisect' option to help drive
the binary search process to find which change introduced a bug,
given an old "good" commit object name and a later "bad" commit
object name.
This command uses 'git-rev-list --bisect' option to help drive the
binary search process to find which change introduced a bug, given an
old "good" commit object name and a later "bad" commit object name.
Basic bisect commands: start, bad, good
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The way you use it is:
------------------------------------------------
$ git bisect start
$ git bisect bad # Current version is bad
$ git bisect good v2.6.13-rc2 # v2.6.13-rc2 was the last version
# tested that was good
$ git bisect bad # Current version is bad
$ git bisect good v2.6.13-rc2 # v2.6.13-rc2 was the last version
# tested that was good
------------------------------------------------
When you give at least one bad and one good versions, it will
bisect the revision tree and say something like:
When you give at least one bad and one good versions, it will bisect
the revision tree and say something like:
------------------------------------------------
Bisecting: 675 revisions left to test after this
------------------------------------------------
and check out the state in the middle. Now, compile that kernel, and boot
it. Now, let's say that this booted kernel works fine, then just do
and check out the state in the middle. Now, compile that kernel, and
boot it. Now, let's say that this booted kernel works fine, then just
do
------------------------------------------------
$ git bisect good # this one is good
@ -57,12 +61,15 @@ which will now say
@@ -57,12 +61,15 @@ which will now say
Bisecting: 337 revisions left to test after this
------------------------------------------------
and you continue along, compiling that one, testing it, and depending on
whether it is good or bad, you say "git bisect good" or "git bisect bad",
and ask for the next bisection.
and you continue along, compiling that one, testing it, and depending
on whether it is good or bad, you say "git bisect good" or "git bisect
bad", and ask for the next bisection.
Until you have no more left, and you'll have been left with the first
bad kernel rev in "refs/bisect/bad".
Until you have no more left, and you'll have been left with the first bad
kernel rev in "refs/bisect/bad".
Bisect reset
~~~~~~~~~~~~
Oh, and then after you want to reset to the original head, do a
@ -70,10 +77,13 @@ Oh, and then after you want to reset to the original head, do a
@@ -70,10 +77,13 @@ Oh, and then after you want to reset to the original head, do a
$ git bisect reset
------------------------------------------------
to get back to the master branch, instead of being in one of the bisection
branches ("git bisect start" will do that for you too, actually: it will
reset the bisection state, and before it does that it checks that you're
not using some old bisection branch).
to get back to the master branch, instead of being in one of the
bisection branches ("git bisect start" will do that for you too,
actually: it will reset the bisection state, and before it does that
it checks that you're not using some old bisection branch).
if test -z "$branch$newbranch" && test "$new" != "$old"
then
detached="$new"
@ -173,9 +180,9 @@ If you want to create a new branch from this checkout, you may do so
@@ -173,9 +180,9 @@ If you want to create a new branch from this checkout, you may do so
(now or later) by using -b with the checkout command again. Example:
git checkout -b <new_branch_name>"
fi
elif test -z "$oldbranch" && test -z "$quiet"
elif test -z "$oldbranch"
then
echo >&2 "Previous HEAD position was $old"
describe_detached_head 'Previous HEAD position was' "$old"
fi
if [ "X$old" = X ]
@ -275,6 +282,7 @@ if [ "$?" -eq 0 ]; then
@@ -275,6 +282,7 @@ if [ "$?" -eq 0 ]; then