]> git.ipfire.org Git - thirdparty/git.git/blame - Documentation/git-bisect-script.txt
GIT 0.99.6
[thirdparty/git.git] / Documentation / git-bisect-script.txt
CommitLineData
7fc9d69f
JH
1git-bisect-script(1)
2====================
3
4NAME
5----
f85a4191 6git-bisect-script - Find the change that introduced a bug
7fc9d69f
JH
7
8
9SYNOPSIS
10--------
f85a4191
JH
11'git bisect' start
12'git bisect' bad <rev>
13'git bisect' good <rev>
14'git bisect' reset [<branch>]
8db9307c
JH
15'git bisect' visualize
16
7fc9d69f
JH
17
18DESCRIPTION
19-----------
f85a4191
JH
20This command uses 'git-rev-list --bisect' option to help drive
21the binary search process to find which change introduced a bug,
22given an old "good" commit object name and a later "bad" commit
23object name.
7fc9d69f 24
f85a4191 25The way you use it is:
7fc9d69f 26
f85a4191
JH
27------------------------------------------------
28git bisect start
29git bisect bad # Current version is bad
30git bisect good v2.6.13-rc2 # v2.6.13-rc2 was the last version
31 # tested that was good
32------------------------------------------------
7fc9d69f 33
f85a4191
JH
34When you give at least one bad and one good versions, it will
35bisect the revision tree and say something like:
36
37------------------------------------------------
38Bisecting: 675 revisions left to test after this
39------------------------------------------------
40
41and check out the state in the middle. Now, compile that kernel, and boot
42it. Now, let's say that this booted kernel works fine, then just do
43
44------------------------------------------------
45git bisect good # this one is good
46------------------------------------------------
47
48which will now say
49
50------------------------------------------------
51Bisecting: 337 revisions left to test after this
52------------------------------------------------
53
54and you continue along, compiling that one, testing it, and depending on
55whether it is good or bad, you say "git bisect good" or "git bisect bad",
56and ask for the next bisection.
57
58Until you have no more left, and you'll have been left with the first bad
59kernel rev in "refs/bisect/bad".
60
61Oh, and then after you want to reset to the original head, do a
62
63------------------------------------------------
64git bisect reset
65------------------------------------------------
66
67to get back to the master branch, instead of being in one of the bisection
68branches ("git bisect start" will do that for you too, actually: it will
69reset the bisection state, and before it does that it checks that you're
70not using some old bisection branch).
7fc9d69f 71
8db9307c
JH
72During the bisection process, you can say
73
74 git bisect visualize
75
76to see the currently remaining suspects in `gitk`.
77
7fc9d69f
JH
78
79Author
80------
81Written by Linus Torvalds <torvalds@osdl.org>
82
83Documentation
84--------------
85Documentation by Junio C Hamano and the git-list <git@vger.kernel.org>.
86
87GIT
88---
89Part of the link:git.html[git] suite
90