Autogenerated man pages for 36de72aa9dc3b7daf8cf2770c840f39bb0d2ae70
[git.git] / man1 / git-bisect.1
1 .\"Generated by db2man.xsl. Don't modify this, modify the source.
2 .de Sh \" Subsection
3 .br
4 .if t .Sp
5 .ne 5
6 .PP
7 \fB\\$1\fR
8 .PP
9 ..
10 .de Sp \" Vertical space (when we can't use .PP)
11 .if t .sp .5v
12 .if n .sp
13 ..
14 .de Ip \" List item
15 .br
16 .ie \\n(.$>=3 .ne \\$3
17 .el .ne 3
18 .IP "\\$1" \\$2
19 ..
20 .TH "GIT-BISECT" 1 "" "" ""
21 .SH NAME
22 git-bisect \- Find the change that introduced a bug
23 .SH "SYNOPSIS"
24
25
26 git bisect <subcommand> <options>
27
28 .SH "DESCRIPTION"
29
30
31 The command takes various subcommands, and different options depending on the subcommand:
32
33 .nf
34 git bisect start [<paths>\&.\&.\&.]
35 git bisect bad <rev>
36 git bisect good <rev>
37 git bisect reset [<branch>]
38 git bisect visualize
39 git bisect replay <logfile>
40 git bisect log
41 .fi
42
43
44 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\&.
45
46
47 The way you use it is:
48
49 .IP
50 $ git bisect start
51 $ git bisect bad                        # Current version is bad
52 $ git bisect good v2\&.6\&.13\-rc2           # v2\&.6\&.13\-rc2 was the last version
53                                         # tested that was good
54
55 When you give at least one bad and one good versions, it will bisect the revision tree and say something like:
56
57 .IP
58 Bisecting: 675 revisions left to test after this
59
60 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
61
62 .IP
63 $ git bisect good                       # this one is good
64
65 which will now say
66
67 .IP
68 Bisecting: 337 revisions left to test after this
69
70 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\&.
71
72
73 Until you have no more left, and you'll have been left with the first bad kernel rev in "refs/bisect/bad"\&.
74
75
76 Oh, and then after you want to reset to the original head, do a
77
78 .IP
79 $ git bisect reset
80
81 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)\&.
82
83
84 During the bisection process, you can say
85
86 .IP
87 $ git bisect visualize
88
89 to see the currently remaining suspects in gitk\&.
90
91
92 The good/bad input is logged, and git bisect log shows what you have done so far\&. You can truncate its output somewhere and save it in a file, and run
93
94 .IP
95 $ git bisect replay that\-file
96
97 if you find later you made a mistake telling good/bad about a revision\&.
98
99
100 If in a middle of bisect session, you know what the bisect suggested to try next is not a good one to test (e\&.g\&. the change the commit introduces is known not to work in your environment and you know it does not have anything to do with the bug you are chasing), you may want to find a near\-by commit and try that instead\&. It goes something like this:
101
102 .IP
103 $ git bisect good/bad                   # previous round was good/bad\&.
104 Bisecting: 337 revisions left to test after this
105 $ git bisect visualize                  # oops, that is uninteresting\&.
106 $ git reset \-\-hard HEAD~3               # try 3 revs before what
107                                         # was suggested
108
109 Then compile and test the one you chose to try\&. After that, tell bisect what the result was as usual\&.
110
111
112 You can further cut down the number of trials if you know what part of the tree is involved in the problem you are tracking down, by giving paths parameters when you say bisect start, like this:
113
114 .IP
115 $ git bisect start arch/i386 include/asm\-i386
116 .SH "AUTHOR"
117
118
119 Written by Linus Torvalds <torvalds@osdl\&.org>
120
121 .SH "DOCUMENTATION"
122
123
124 Documentation by Junio C Hamano and the git\-list <git@vger\&.kernel\&.org>\&.
125
126 .SH "GIT"
127
128
129 Part of the \fBgit\fR(7) suite
130