blob: fbb39fbdf5d62a455c8b62d4870817998d0434ad [file] [log] [blame]
Junio C Hamano1a4e8412005-12-27 08:17:231git-bisect(1)
2=============
3
4NAME
5----
Junio C Hamano9c512872015-08-12 21:59:256git-bisect - Use binary search to find the commit that introduced a bug
Junio C Hamano1a4e8412005-12-27 08:17:237
8
9SYNOPSIS
10--------
Junio C Hamano15567bc2011-07-23 00:51:5911[verse]
Junio C Hamanoa77a5132007-06-08 16:13:4412'git bisect' <subcommand> <options>
Junio C Hamano1a4e8412005-12-27 08:17:2313
14DESCRIPTION
15-----------
Junio C Hamanob60308a2007-03-24 07:16:4216The command takes various subcommands, and different options depending
17on the subcommand:
Junio C Hamano1a4e8412005-12-27 08:17:2318
Junio C Hamano558abd22020-09-03 20:22:3419 git bisect start [--term-{new,bad}=<term> --term-{old,good}=<term>]
Junio C Hamano255163d2020-08-18 00:37:2320 [--no-checkout] [--first-parent] [<bad> [<good>...]] [--] [<paths>...]
Junio C Hamanobcd98f42017-01-24 00:12:1621 git bisect (bad|new|<term-new>) [<rev>]
22 git bisect (good|old|<term-old>) [<rev>...]
Junio C Hamano1eb56092015-10-05 20:39:5323 git bisect terms [--term-good | --term-bad]
Junio C Hamanod796cea2008-12-03 03:51:1024 git bisect skip [(<rev>|<range>)...]
Junio C Hamanoc21ab052009-10-31 04:03:5525 git bisect reset [<commit>]
Junio C Hamanob72f6032017-11-15 05:57:0826 git bisect (visualize|view)
Junio C Hamano1a4e8412005-12-27 08:17:2327 git bisect replay <logfile>
28 git bisect log
Junio C Hamanof440a232007-03-23 10:46:1729 git bisect run <cmd>...
Junio C Hamano9c512872015-08-12 21:59:2530 git bisect help
Junio C Hamano1a4e8412005-12-27 08:17:2331
Junio C Hamano9c512872015-08-12 21:59:2532This command uses a binary search algorithm to find which commit in
33your project's history introduced a bug. You use it by first telling
34it a "bad" commit that is known to contain the bug, and a "good"
35commit that is known to be before the bug was introduced. Then `git
36bisect` picks a commit between those two endpoints and asks you
37whether the selected commit is "good" or "bad". It continues narrowing
38down the range until it finds the exact commit that introduced the
39change.
Junio C Hamanoe79159d2008-04-12 08:23:1740
Junio C Hamano1eb56092015-10-05 20:39:5341In fact, `git bisect` can be used to find the commit that changed
42*any* property of your project; e.g., the commit that fixed a bug, or
43the commit that caused a benchmark's performance to improve. To
44support this more general usage, the terms "old" and "new" can be used
45in place of "good" and "bad", or you can choose your own terms. See
46section "Alternate terms" below for more information.
47
Junio C Hamanob60308a2007-03-24 07:16:4248Basic bisect commands: start, bad, good
49~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Junio C Hamano1a4e8412005-12-27 08:17:2350
Junio C Hamano9c512872015-08-12 21:59:2551As an example, suppose you are trying to find the commit that broke a
52feature that was known to work in version `v2.6.13-rc2` of your
53project. You start a bisect session as follows:
Junio C Hamano1a4e8412005-12-27 08:17:2354
55------------------------------------------------
56$ git bisect start
Junio C Hamanob60308a2007-03-24 07:16:4257$ git bisect bad # Current version is bad
Junio C Hamano9c512872015-08-12 21:59:2558$ git bisect good v2.6.13-rc2 # v2.6.13-rc2 is known to be good
Junio C Hamano1a4e8412005-12-27 08:17:2359------------------------------------------------
60
Junio C Hamano9c512872015-08-12 21:59:2561Once you have specified at least one bad and one good commit, `git
62bisect` selects a commit in the middle of that range of history,
63checks it out, and outputs something similar to the following:
Junio C Hamano1a4e8412005-12-27 08:17:2364
65------------------------------------------------
Junio C Hamano9c512872015-08-12 21:59:2566Bisecting: 675 revisions left to test after this (roughly 10 steps)
Junio C Hamano1a4e8412005-12-27 08:17:2367------------------------------------------------
68
Junio C Hamano9c512872015-08-12 21:59:2569You should now compile the checked-out version and test it. If that
70version works correctly, type
Junio C Hamano1a4e8412005-12-27 08:17:2371
72------------------------------------------------
Junio C Hamano9c512872015-08-12 21:59:2573$ git bisect good
Junio C Hamano1a4e8412005-12-27 08:17:2374------------------------------------------------
75
Junio C Hamano9c512872015-08-12 21:59:2576If that version is broken, type
Junio C Hamano1a4e8412005-12-27 08:17:2377
78------------------------------------------------
Junio C Hamano9c512872015-08-12 21:59:2579$ git bisect bad
Junio C Hamano1a4e8412005-12-27 08:17:2380------------------------------------------------
81
Junio C Hamano9c512872015-08-12 21:59:2582Then `git bisect` will respond with something like
Junio C Hamano1a4e8412005-12-27 08:17:2383
Junio C Hamano9c512872015-08-12 21:59:2584------------------------------------------------
85Bisecting: 337 revisions left to test after this (roughly 9 steps)
86------------------------------------------------
87
88Keep repeating the process: compile the tree, test it, and depending
89on whether it is good or bad run `git bisect good` or `git bisect bad`
90to ask for the next commit that needs testing.
91
92Eventually there will be no more revisions left to inspect, and the
93command will print out a description of the first bad commit. The
94reference `refs/bisect/bad` will be left pointing at that commit.
95
Junio C Hamanob60308a2007-03-24 07:16:4296
97Bisect reset
98~~~~~~~~~~~~
Junio C Hamano1a4e8412005-12-27 08:17:2399
Junio C Hamanoc21ab052009-10-31 04:03:55100After a bisect session, to clean up the bisection state and return to
Junio C Hamano9c512872015-08-12 21:59:25101the original HEAD, issue the following command:
Junio C Hamano1a4e8412005-12-27 08:17:23102
103------------------------------------------------
104$ git bisect reset
105------------------------------------------------
106
Junio C Hamanoc21ab052009-10-31 04:03:55107By default, this will return your tree to the commit that was checked
108out before `git bisect start`. (A new `git bisect start` will also do
109that, as it cleans up the old bisection state.)
110
111With an optional argument, you can return to a different commit
112instead:
113
114------------------------------------------------
115$ git bisect reset <commit>
116------------------------------------------------
117
Junio C Hamano9c512872015-08-12 21:59:25118For example, `git bisect reset bisect/bad` will check out the first
119bad revision, while `git bisect reset HEAD` will leave you on the
120current bisection commit and avoid switching commits at all.
121
Junio C Hamanob60308a2007-03-24 07:16:42122
Junio C Hamano1eb56092015-10-05 20:39:53123Alternate terms
124~~~~~~~~~~~~~~~
125
126Sometimes you are not looking for the commit that introduced a
127breakage, but rather for a commit that caused a change between some
128other "old" state and "new" state. For example, you might be looking
129for the commit that introduced a particular fix. Or you might be
130looking for the first commit in which the source-code filenames were
131finally all converted to your company's naming standard. Or whatever.
132
133In such cases it can be very confusing to use the terms "good" and
134"bad" to refer to "the state before the change" and "the state after
135the change". So instead, you can use the terms "old" and "new",
136respectively, in place of "good" and "bad". (But note that you cannot
137mix "good" and "bad" with "old" and "new" in a single session.)
138
139In this more general usage, you provide `git bisect` with a "new"
Junio C Hamano761b4812017-04-17 07:27:59140commit that has some property and an "old" commit that doesn't have that
Junio C Hamano1eb56092015-10-05 20:39:53141property. Each time `git bisect` checks out a commit, you test if that
142commit has the property. If it does, mark the commit as "new";
143otherwise, mark it as "old". When the bisection is done, `git bisect`
144will report which commit introduced the property.
145
146To use "old" and "new" instead of "good" and bad, you must run `git
147bisect start` without commits as argument and then run the following
148commands to add the commits:
149
150------------------------------------------------
151git bisect old [<rev>]
152------------------------------------------------
153
154to indicate that a commit was before the sought change, or
155
156------------------------------------------------
157git bisect new [<rev>...]
158------------------------------------------------
159
160to indicate that it was after.
161
162To get a reminder of the currently used terms, use
163
164------------------------------------------------
165git bisect terms
166------------------------------------------------
167
Junio C Hamano96153bf2018-04-25 08:25:34168You can get just the old (respectively new) term with `git bisect terms
169--term-old` or `git bisect terms --term-good`.
Junio C Hamano1eb56092015-10-05 20:39:53170
171If you would like to use your own terms instead of "bad"/"good" or
172"new"/"old", you can choose any names you like (except existing bisect
173subcommands like `reset`, `start`, ...) by starting the
174bisection using
175
176------------------------------------------------
177git bisect start --term-old <term-old> --term-new <term-new>
178------------------------------------------------
179
180For example, if you are looking for a commit that introduced a
181performance regression, you might use
182
183------------------------------------------------
184git bisect start --term-old fast --term-new slow
185------------------------------------------------
186
187Or if you are looking for the commit that fixed a bug, you might use
188
189------------------------------------------------
190git bisect start --term-new fixed --term-old broken
191------------------------------------------------
192
193Then, use `git bisect <term-old>` and `git bisect <term-new>` instead
194of `git bisect good` and `git bisect bad` to mark commits.
195
Junio C Hamanob72f6032017-11-15 05:57:08196Bisect visualize/view
197~~~~~~~~~~~~~~~~~~~~~
Junio C Hamano1a4e8412005-12-27 08:17:23198
Junio C Hamano1de75722009-03-26 08:39:38199To see the currently remaining suspects in 'gitk', issue the following
Junio C Hamanob72f6032017-11-15 05:57:08200command during the bisection process (the subcommand `view` can be used
201as an alternative to `visualize`):
Junio C Hamano1a4e8412005-12-27 08:17:23202
203------------
204$ git bisect visualize
205------------
206
Junio C Hamano042f2142016-06-27 18:05:05207If the `DISPLAY` environment variable is not set, 'git log' is used
Junio C Hamanoe1aeb5e2014-06-06 19:16:29208instead. You can also give command-line options such as `-p` and
Junio C Hamano942b35e2007-12-09 10:19:33209`--stat`.
210
211------------
Junio C Hamanob72f6032017-11-15 05:57:08212$ git bisect visualize --stat
Junio C Hamano942b35e2007-12-09 10:19:33213------------
Junio C Hamano1a4e8412005-12-27 08:17:23214
Junio C Hamanob60308a2007-03-24 07:16:42215Bisect log and bisect replay
216~~~~~~~~~~~~~~~~~~~~~~~~~~~~
217
Junio C Hamano1de75722009-03-26 08:39:38218After having marked revisions as good or bad, issue the following
Junio C Hamanofd83b8e2009-03-22 08:21:41219command to show what has been done so far:
Junio C Hamanob60308a2007-03-24 07:16:42220
221------------
222$ git bisect log
223------------
224
Junio C Hamanofd83b8e2009-03-22 08:21:41225If you discover that you made a mistake in specifying the status of a
226revision, you can save the output of this command to a file, edit it to
227remove the incorrect entries, and then issue the following commands to
228return to a corrected state:
Junio C Hamano1a4e8412005-12-27 08:17:23229
230------------
Junio C Hamanofd83b8e2009-03-22 08:21:41231$ git bisect reset
Junio C Hamano1a4e8412005-12-27 08:17:23232$ git bisect replay that-file
233------------
234
Junio C Hamanofd83b8e2009-03-22 08:21:41235Avoiding testing a commit
Junio C Hamanob60308a2007-03-24 07:16:42236~~~~~~~~~~~~~~~~~~~~~~~~~
237
Junio C Hamano9c512872015-08-12 21:59:25238If, in the middle of a bisect session, you know that the suggested
239revision is not a good one to test (e.g. it fails to build and you
240know that the failure does not have anything to do with the bug you
241are chasing), you can manually select a nearby commit and test that
242one instead.
Junio C Hamanob60308a2007-03-24 07:16:42243
Junio C Hamanofd83b8e2009-03-22 08:21:41244For example:
Junio C Hamano1a4e8412005-12-27 08:17:23245
246------------
Junio C Hamanofd83b8e2009-03-22 08:21:41247$ git bisect good/bad # previous round was good or bad.
Junio C Hamano9c512872015-08-12 21:59:25248Bisecting: 337 revisions left to test after this (roughly 9 steps)
Junio C Hamano1a4e8412005-12-27 08:17:23249$ git bisect visualize # oops, that is uninteresting.
Junio C Hamanofd83b8e2009-03-22 08:21:41250$ git reset --hard HEAD~3 # try 3 revisions before what
Junio C Hamano1a4e8412005-12-27 08:17:23251# was suggested
252------------
253
Junio C Hamano1de75722009-03-26 08:39:38254Then compile and test the chosen revision, and afterwards mark
255the revision as good or bad in the usual manner.
Junio C Hamano1a4e8412005-12-27 08:17:23256
Junio C Hamano1974bf22007-10-31 05:57:20257Bisect skip
Junio C Hamanoee615802015-10-29 21:45:26258~~~~~~~~~~~
Junio C Hamano1974bf22007-10-31 05:57:20259
Junio C Hamano9c512872015-08-12 21:59:25260Instead of choosing a nearby commit by yourself, you can ask Git to do
261it for you by issuing the command:
Junio C Hamano1974bf22007-10-31 05:57:20262
263------------
264$ git bisect skip # Current version cannot be tested
265------------
266
Junio C Hamano9c512872015-08-12 21:59:25267However, if you skip a commit adjacent to the one you are looking for,
268Git will be unable to tell exactly which of those commits was the
269first bad one.
Junio C Hamano1974bf22007-10-31 05:57:20270
Junio C Hamano9c512872015-08-12 21:59:25271You can also skip a range of commits, instead of just one commit,
272using range notation. For example:
Junio C Hamanod796cea2008-12-03 03:51:10273
274------------
275$ git bisect skip v2.5..v2.6
276------------
277
Junio C Hamano1de75722009-03-26 08:39:38278This tells the bisect process that no commit after `v2.5`, up to and
279including `v2.6`, should be tested.
Junio C Hamanod796cea2008-12-03 03:51:10280
Junio C Hamanofd83b8e2009-03-22 08:21:41281Note that if you also want to skip the first commit of the range you
282would issue the command:
Junio C Hamanod796cea2008-12-03 03:51:10283
284------------
285$ git bisect skip v2.5 v2.5..v2.6
286------------
287
Junio C Hamano9c512872015-08-12 21:59:25288This tells the bisect process that the commits between `v2.5` and
289`v2.6` (inclusive) should be skipped.
Junio C Hamanofd83b8e2009-03-22 08:21:41290
Junio C Hamanod796cea2008-12-03 03:51:10291
Junio C Hamano12a3a232007-04-07 10:18:10292Cutting down bisection by giving more parameters to bisect start
293~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Junio C Hamanob60308a2007-03-24 07:16:42294
Junio C Hamanofd83b8e2009-03-22 08:21:41295You can further cut down the number of trials, if you know what part of
296the tree is involved in the problem you are tracking down, by specifying
297path parameters when issuing the `bisect start` command:
Junio C Hamano1a4e8412005-12-27 08:17:23298
299------------
Junio C Hamano12a3a232007-04-07 10:18:10300$ git bisect start -- arch/i386 include/asm-i386
301------------
302
Junio C Hamanofd83b8e2009-03-22 08:21:41303If you know beforehand more than one good commit, you can narrow the
304bisect space down by specifying all of the good commits immediately after
305the bad commit when issuing the `bisect start` command:
Junio C Hamano12a3a232007-04-07 10:18:10306
307------------
308$ git bisect start v2.6.20-rc6 v2.6.20-rc4 v2.6.20-rc1 --
309 # v2.6.20-rc6 is bad
310 # v2.6.20-rc4 and v2.6.20-rc1 are good
Junio C Hamano1a4e8412005-12-27 08:17:23311------------
312
Junio C Hamanob60308a2007-03-24 07:16:42313Bisect run
314~~~~~~~~~~
315
316If you have a script that can tell if the current source code is good
Junio C Hamanofd83b8e2009-03-22 08:21:41317or bad, you can bisect by issuing the command:
Junio C Hamanof440a232007-03-23 10:46:17318
319------------
Junio C Hamano0a235222009-03-06 08:21:09320$ git bisect run my_script arguments
Junio C Hamanof440a232007-03-23 10:46:17321------------
322
Junio C Hamano9c512872015-08-12 21:59:25323Note that the script (`my_script` in the above example) should exit
324with code 0 if the current source code is good/old, and exit with a
325code between 1 and 127 (inclusive), except 125, if the current source
326code is bad/new.
Junio C Hamanof440a232007-03-23 10:46:17327
Junio C Hamanofd83b8e2009-03-22 08:21:41328Any other exit code will abort the bisect process. It should be noted
Junio C Hamano9c512872015-08-12 21:59:25329that a program that terminates via `exit(-1)` leaves $? = 255, (see the
330exit(3) manual page), as the value is chopped with `& 0377`.
Junio C Hamanof440a232007-03-23 10:46:17331
Junio C Hamano1974bf22007-10-31 05:57:20332The special exit code 125 should be used when the current source code
Junio C Hamanofd83b8e2009-03-22 08:21:41333cannot be tested. If the script exits with this code, the current
Junio C Hamanod2c978f2011-03-20 19:42:22334revision will be skipped (see `git bisect skip` above). 125 was chosen
335as the highest sensible value to use for this purpose, because 126 and 127
336are used by POSIX shells to signal specific error status (127 is for
Junio C Hamanoee615802015-10-29 21:45:26337command not found, 126 is for command found but not executable--these
Junio C Hamanod2c978f2011-03-20 19:42:22338details do not matter, as they are normal errors in the script, as far as
Junio C Hamano9c512872015-08-12 21:59:25339`bisect run` is concerned).
Junio C Hamano1974bf22007-10-31 05:57:20340
Junio C Hamanofd83b8e2009-03-22 08:21:41341You may often find that during a bisect session you want to have
342temporary modifications (e.g. s/#define DEBUG 0/#define DEBUG 1/ in a
343header file, or "revision that does not have this commit needs this
344patch applied to work around another problem this bisection is not
345interested in") applied to the revision being tested.
Junio C Hamanof440a232007-03-23 10:46:17346
Junio C Hamano175a1bd2008-11-10 00:08:57347To cope with such a situation, after the inner 'git bisect' finds the
Junio C Hamanofd83b8e2009-03-22 08:21:41348next revision to test, the script can apply the patch
349before compiling, run the real test, and afterwards decide if the
350revision (possibly with the needed patch) passed the test and then
351rewind the tree to the pristine state. Finally the script should exit
Junio C Hamano9c512872015-08-12 21:59:25352with the status of the real test to let the `git bisect run` command loop
Junio C Hamanofd83b8e2009-03-22 08:21:41353determine the eventual outcome of the bisect session.
Junio C Hamano1a4e8412005-12-27 08:17:23354
Junio C Hamanof7279012011-08-18 06:13:13355OPTIONS
356-------
357--no-checkout::
358+
359Do not checkout the new working tree at each iteration of the bisection
Junio C Hamano92d80372016-07-13 22:00:05360process. Instead just update a special reference named `BISECT_HEAD` to make
Junio C Hamanof7279012011-08-18 06:13:13361it point to the commit that should be tested.
362+
363This option may be useful when the test you would perform in each step
364does not require a checked out tree.
365+
366If the repository is bare, `--no-checkout` is assumed.
367
Junio C Hamano255163d2020-08-18 00:37:23368--first-parent::
369+
370Follow only the first parent commit upon seeing a merge commit.
371+
372In detecting regressions introduced through the merging of a branch, the merge
373commit will be identified as introduction of the bug and its ancestors will be
374ignored.
375+
376This option is particularly useful in avoiding false positives when a merged
377branch contained broken or non-buildable commits, but the merge itself was OK.
378
Junio C Hamano6d76d612008-05-09 05:46:08379EXAMPLES
380--------
381
382* Automatically bisect a broken build between v1.2 and HEAD:
383+
384------------
385$ git bisect start HEAD v1.2 -- # HEAD is bad, v1.2 is good
386$ git bisect run make # "make" builds the app
Junio C Hamano97cc08f2013-02-14 21:11:15387$ git bisect reset # quit the bisect session
Junio C Hamano6d76d612008-05-09 05:46:08388------------
389
Junio C Hamano0a235222009-03-06 08:21:09390* Automatically bisect a test failure between origin and HEAD:
391+
392------------
393$ git bisect start HEAD origin -- # HEAD is bad, origin is good
394$ git bisect run make test # "make test" builds and tests
Junio C Hamano97cc08f2013-02-14 21:11:15395$ git bisect reset # quit the bisect session
Junio C Hamano0a235222009-03-06 08:21:09396------------
397
Junio C Hamano6d76d612008-05-09 05:46:08398* Automatically bisect a broken test case:
399+
400------------
401$ cat ~/test.sh
402#!/bin/sh
Junio C Hamanofd83b8e2009-03-22 08:21:41403make || exit 125 # this skips broken builds
Junio C Hamano9a2fb2d2011-03-23 05:40:15404~/check_test_case.sh # does the test case pass?
Junio C Hamano6d76d612008-05-09 05:46:08405$ git bisect start HEAD HEAD~10 -- # culprit is among the last 10
406$ git bisect run ~/test.sh
Junio C Hamano97cc08f2013-02-14 21:11:15407$ git bisect reset # quit the bisect session
Junio C Hamano6d76d612008-05-09 05:46:08408------------
409+
Junio C Hamano9c512872015-08-12 21:59:25410Here we use a `test.sh` custom script. In this script, if `make`
Junio C Hamano9a2fb2d2011-03-23 05:40:15411fails, we skip the current commit.
Junio C Hamano9c512872015-08-12 21:59:25412`check_test_case.sh` should `exit 0` if the test case passes,
413and `exit 1` otherwise.
Junio C Hamano6d76d612008-05-09 05:46:08414+
Junio C Hamano9c512872015-08-12 21:59:25415It is safer if both `test.sh` and `check_test_case.sh` are
Junio C Hamanofd83b8e2009-03-22 08:21:41416outside the repository to prevent interactions between the bisect,
417make and test processes and the scripts.
Junio C Hamano6d76d612008-05-09 05:46:08418
Junio C Hamano9a2fb2d2011-03-23 05:40:15419* Automatically bisect with temporary modifications (hot-fix):
420+
421------------
422$ cat ~/test.sh
423#!/bin/sh
424
425# tweak the working tree by merging the hot-fix branch
426# and then attempt a build
Junio C Hamano8ef91f32019-12-01 22:58:27427if git merge --no-commit --no-ff hot-fix &&
Junio C Hamano9a2fb2d2011-03-23 05:40:15428make
429then
430# run project specific test and report its status
431~/check_test_case.sh
432status=$?
433else
434# tell the caller this is untestable
435status=125
436fi
437
438# undo the tweak to allow clean flipping to the next commit
439git reset --hard
440
441# return control
442exit $status
443------------
444+
445This applies modifications from a hot-fix branch before each test run,
446e.g. in case your build or test environment changed so that older
447revisions may need a fix which newer ones have already. (Make sure the
448hot-fix branch is based off a commit which is contained in all revisions
449which you are bisecting, so that the merge does not pull in too much, or
450use `git cherry-pick` instead of `git merge`.)
451
452* Automatically bisect a broken test case:
Junio C Hamano0a235222009-03-06 08:21:09453+
454------------
455$ git bisect start HEAD HEAD~10 -- # culprit is among the last 10
456$ git bisect run sh -c "make || exit 125; ~/check_test_case.sh"
Junio C Hamano97cc08f2013-02-14 21:11:15457$ git bisect reset # quit the bisect session
Junio C Hamano0a235222009-03-06 08:21:09458------------
459+
Junio C Hamano9a2fb2d2011-03-23 05:40:15460This shows that you can do without a run script if you write the test
461on a single line.
Junio C Hamano0a235222009-03-06 08:21:09462
Junio C Hamanof7279012011-08-18 06:13:13463* Locate a good region of the object graph in a damaged repository
464+
465------------
466$ git bisect start HEAD <known-good-commit> [ <boundary-commit> ... ] --no-checkout
467$ git bisect run sh -c '
468GOOD=$(git for-each-ref "--format=%(objectname)" refs/bisect/good-*) &&
469git rev-list --objects BISECT_HEAD --not $GOOD >tmp.$$ &&
470git pack-objects --stdout >/dev/null <tmp.$$
471rc=$?
472rm -f tmp.$$
473test $rc = 0'
474
Junio C Hamano97cc08f2013-02-14 21:11:15475$ git bisect reset # quit the bisect session
Junio C Hamanof7279012011-08-18 06:13:13476------------
477+
478In this case, when 'git bisect run' finishes, bisect/bad will refer to a commit that
479has at least one parent whose reachable graph is fully traversable in the sense
480required by 'git pack objects'.
481
Junio C Hamano1eb56092015-10-05 20:39:53482* Look for a fix instead of a regression in the code
483+
484------------
485$ git bisect start
486$ git bisect new HEAD # current commit is marked as new
487$ git bisect old HEAD~10 # the tenth commit from now is marked as old
488------------
489+
490or:
491------------
492$ git bisect start --term-old broken --term-new fixed
493$ git bisect fixed
494$ git bisect broken HEAD~10
495------------
496
Junio C Hamano9c512872015-08-12 21:59:25497Getting help
498~~~~~~~~~~~~
499
500Use `git bisect` to get a short usage description, and `git bisect
501help` or `git bisect -h` to get a long usage description.
Junio C Hamanof7279012011-08-18 06:13:13502
Junio C Hamano2bd8a742009-12-01 21:16:59503SEE ALSO
504--------
505link:git-bisect-lk2009.html[Fighting regressions with git bisect],
506linkgit:git-blame[1].
507
Junio C Hamano1a4e8412005-12-27 08:17:23508GIT
509---
Junio C Hamanof7c042d2008-06-06 22:50:53510Part of the linkgit:git[1] suite