Autogenerated HTML docs for v1.7.6-549-gf85a0
[git/jnareb-git.git] / git-bisect.html
blob1bc92153dc18ab6f95c8840ff6ca5a019c44e94e
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
2 "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
3 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
4 <head>
5 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
6 <meta name="generator" content="AsciiDoc 8.4.5" />
7 <title>git-bisect(1)</title>
8 <style type="text/css">
9 /* Debug borders */
10 p, li, dt, dd, div, pre, h1, h2, h3, h4, h5, h6 {
12 border: 1px solid red;
16 body {
17 margin: 1em 5% 1em 5%;
20 a {
21 color: blue;
22 text-decoration: underline;
24 a:visited {
25 color: fuchsia;
28 em {
29 font-style: italic;
30 color: navy;
33 strong {
34 font-weight: bold;
35 color: #083194;
38 tt {
39 color: navy;
42 h1, h2, h3, h4, h5, h6 {
43 color: #527bbd;
44 font-family: sans-serif;
45 margin-top: 1.2em;
46 margin-bottom: 0.5em;
47 line-height: 1.3;
50 h1, h2, h3 {
51 border-bottom: 2px solid silver;
53 h2 {
54 padding-top: 0.5em;
56 h3 {
57 float: left;
59 h3 + * {
60 clear: left;
63 div.sectionbody {
64 font-family: serif;
65 margin-left: 0;
68 hr {
69 border: 1px solid silver;
72 p {
73 margin-top: 0.5em;
74 margin-bottom: 0.5em;
77 ul, ol, li > p {
78 margin-top: 0;
81 pre {
82 padding: 0;
83 margin: 0;
86 span#author {
87 color: #527bbd;
88 font-family: sans-serif;
89 font-weight: bold;
90 font-size: 1.1em;
92 span#email {
94 span#revnumber, span#revdate, span#revremark {
95 font-family: sans-serif;
98 div#footer {
99 font-family: sans-serif;
100 font-size: small;
101 border-top: 2px solid silver;
102 padding-top: 0.5em;
103 margin-top: 4.0em;
105 div#footer-text {
106 float: left;
107 padding-bottom: 0.5em;
109 div#footer-badges {
110 float: right;
111 padding-bottom: 0.5em;
114 div#preamble {
115 margin-top: 1.5em;
116 margin-bottom: 1.5em;
118 div.tableblock, div.imageblock, div.exampleblock, div.verseblock,
119 div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock,
120 div.admonitionblock {
121 margin-top: 1.5em;
122 margin-bottom: 1.5em;
124 div.admonitionblock {
125 margin-top: 2.5em;
126 margin-bottom: 2.5em;
129 div.content { /* Block element content. */
130 padding: 0;
133 /* Block element titles. */
134 div.title, caption.title {
135 color: #527bbd;
136 font-family: sans-serif;
137 font-weight: bold;
138 text-align: left;
139 margin-top: 1.0em;
140 margin-bottom: 0.5em;
142 div.title + * {
143 margin-top: 0;
146 td div.title:first-child {
147 margin-top: 0.0em;
149 div.content div.title:first-child {
150 margin-top: 0.0em;
152 div.content + div.title {
153 margin-top: 0.0em;
156 div.sidebarblock > div.content {
157 background: #ffffee;
158 border: 1px solid silver;
159 padding: 0.5em;
162 div.listingblock > div.content {
163 border: 1px solid silver;
164 background: #f4f4f4;
165 padding: 0.5em;
168 div.quoteblock {
169 padding-left: 2.0em;
170 margin-right: 10%;
172 div.quoteblock > div.attribution {
173 padding-top: 0.5em;
174 text-align: right;
177 div.verseblock {
178 padding-left: 2.0em;
179 margin-right: 10%;
181 div.verseblock > div.content {
182 white-space: pre;
184 div.verseblock > div.attribution {
185 padding-top: 0.75em;
186 text-align: left;
188 /* DEPRECATED: Pre version 8.2.7 verse style literal block. */
189 div.verseblock + div.attribution {
190 text-align: left;
193 div.admonitionblock .icon {
194 vertical-align: top;
195 font-size: 1.1em;
196 font-weight: bold;
197 text-decoration: underline;
198 color: #527bbd;
199 padding-right: 0.5em;
201 div.admonitionblock td.content {
202 padding-left: 0.5em;
203 border-left: 2px solid silver;
206 div.exampleblock > div.content {
207 border-left: 2px solid silver;
208 padding: 0.5em;
211 div.imageblock div.content { padding-left: 0; }
212 span.image img { border-style: none; }
213 a.image:visited { color: white; }
215 dl {
216 margin-top: 0.8em;
217 margin-bottom: 0.8em;
219 dt {
220 margin-top: 0.5em;
221 margin-bottom: 0;
222 font-style: normal;
223 color: navy;
225 dd > *:first-child {
226 margin-top: 0.1em;
229 ul, ol {
230 list-style-position: outside;
232 ol.arabic {
233 list-style-type: decimal;
235 ol.loweralpha {
236 list-style-type: lower-alpha;
238 ol.upperalpha {
239 list-style-type: upper-alpha;
241 ol.lowerroman {
242 list-style-type: lower-roman;
244 ol.upperroman {
245 list-style-type: upper-roman;
248 div.compact ul, div.compact ol,
249 div.compact p, div.compact p,
250 div.compact div, div.compact div {
251 margin-top: 0.1em;
252 margin-bottom: 0.1em;
255 div.tableblock > table {
256 border: 3px solid #527bbd;
258 thead {
259 font-family: sans-serif;
260 font-weight: bold;
262 tfoot {
263 font-weight: bold;
265 td > div.verse {
266 white-space: pre;
268 p.table {
269 margin-top: 0;
271 /* Because the table frame attribute is overriden by CSS in most browsers. */
272 div.tableblock > table[frame="void"] {
273 border-style: none;
275 div.tableblock > table[frame="hsides"] {
276 border-left-style: none;
277 border-right-style: none;
279 div.tableblock > table[frame="vsides"] {
280 border-top-style: none;
281 border-bottom-style: none;
285 div.hdlist {
286 margin-top: 0.8em;
287 margin-bottom: 0.8em;
289 div.hdlist tr {
290 padding-bottom: 15px;
292 dt.hdlist1.strong, td.hdlist1.strong {
293 font-weight: bold;
295 td.hdlist1 {
296 vertical-align: top;
297 font-style: normal;
298 padding-right: 0.8em;
299 color: navy;
301 td.hdlist2 {
302 vertical-align: top;
304 div.hdlist.compact tr {
305 margin: 0;
306 padding-bottom: 0;
309 .comment {
310 background: yellow;
313 @media print {
314 div#footer-badges { display: none; }
317 div#toctitle {
318 color: #527bbd;
319 font-family: sans-serif;
320 font-size: 1.1em;
321 font-weight: bold;
322 margin-top: 1.0em;
323 margin-bottom: 0.1em;
326 div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 {
327 margin-top: 0;
328 margin-bottom: 0;
330 div.toclevel2 {
331 margin-left: 2em;
332 font-size: 0.9em;
334 div.toclevel3 {
335 margin-left: 4em;
336 font-size: 0.9em;
338 div.toclevel4 {
339 margin-left: 6em;
340 font-size: 0.9em;
342 /* Overrides for manpage documents */
343 h1 {
344 padding-top: 0.5em;
345 padding-bottom: 0.5em;
346 border-top: 2px solid silver;
347 border-bottom: 2px solid silver;
349 h2 {
350 border-style: none;
352 div.sectionbody {
353 margin-left: 5%;
356 @media print {
357 div#toc { display: none; }
360 /* Workarounds for IE6's broken and incomplete CSS2. */
362 div.sidebar-content {
363 background: #ffffee;
364 border: 1px solid silver;
365 padding: 0.5em;
367 div.sidebar-title, div.image-title {
368 color: #527bbd;
369 font-family: sans-serif;
370 font-weight: bold;
371 margin-top: 0.0em;
372 margin-bottom: 0.5em;
375 div.listingblock div.content {
376 border: 1px solid silver;
377 background: #f4f4f4;
378 padding: 0.5em;
381 div.quoteblock-attribution {
382 padding-top: 0.5em;
383 text-align: right;
386 div.verseblock-content {
387 white-space: pre;
389 div.verseblock-attribution {
390 padding-top: 0.75em;
391 text-align: left;
394 div.exampleblock-content {
395 border-left: 2px solid silver;
396 padding-left: 0.5em;
399 /* IE6 sets dynamically generated links as visited. */
400 div#toc a:visited { color: blue; }
401 </style>
402 </head>
403 <body>
404 <div id="header">
405 <h1>
406 git-bisect(1) Manual Page
407 </h1>
408 <h2>NAME</h2>
409 <div class="sectionbody">
410 <p>git-bisect -
411 Find by binary search the change that introduced a bug
412 </p>
413 </div>
414 </div>
415 <h2 id="_synopsis">SYNOPSIS</h2>
416 <div class="sectionbody">
417 <div class="verseblock">
418 <div class="verseblock-content"><em>git bisect</em> &lt;subcommand&gt; &lt;options&gt;</div>
419 <div class="verseblock-attribution">
420 </div></div>
421 </div>
422 <h2 id="_description">DESCRIPTION</h2>
423 <div class="sectionbody">
424 <div class="paragraph"><p>The command takes various subcommands, and different options depending
425 on the subcommand:</p></div>
426 <div class="literalblock">
427 <div class="content">
428 <pre><tt>git bisect help
429 git bisect start [--no-checkout] [&lt;bad&gt; [&lt;good&gt;...]] [--] [&lt;paths&gt;...]
430 git bisect bad [&lt;rev&gt;]
431 git bisect good [&lt;rev&gt;...]
432 git bisect skip [(&lt;rev&gt;|&lt;range&gt;)...]
433 git bisect reset [&lt;commit&gt;]
434 git bisect visualize
435 git bisect replay &lt;logfile&gt;
436 git bisect log
437 git bisect run &lt;cmd&gt;...</tt></pre>
438 </div></div>
439 <div class="paragraph"><p>This command uses <em>git rev-list --bisect</em> to help drive the
440 binary search process to find which change introduced a bug, given an
441 old "good" commit object name and a later "bad" commit object name.</p></div>
442 <h3 id="_getting_help">Getting help</h3><div style="clear:left"></div>
443 <div class="paragraph"><p>Use "git bisect" to get a short usage description, and "git bisect
444 help" or "git bisect -h" to get a long usage description.</p></div>
445 <h3 id="_basic_bisect_commands_start_bad_good">Basic bisect commands: start, bad, good</h3><div style="clear:left"></div>
446 <div class="paragraph"><p>Using the Linux kernel tree as an example, basic use of the bisect
447 command is as follows:</p></div>
448 <div class="listingblock">
449 <div class="content">
450 <pre><tt>$ git bisect start
451 $ git bisect bad # Current version is bad
452 $ git bisect good v2.6.13-rc2 # v2.6.13-rc2 was the last version
453 # tested that was good</tt></pre>
454 </div></div>
455 <div class="paragraph"><p>When you have specified at least one bad and one good version, the
456 command bisects the revision tree and outputs something similar to
457 the following:</p></div>
458 <div class="listingblock">
459 <div class="content">
460 <pre><tt>Bisecting: 675 revisions left to test after this</tt></pre>
461 </div></div>
462 <div class="paragraph"><p>The state in the middle of the set of revisions is then checked out.
463 You would now compile that kernel and boot it. If the booted kernel
464 works correctly, you would then issue the following command:</p></div>
465 <div class="listingblock">
466 <div class="content">
467 <pre><tt>$ git bisect good # this one is good</tt></pre>
468 </div></div>
469 <div class="paragraph"><p>The output of this command would be something similar to the following:</p></div>
470 <div class="listingblock">
471 <div class="content">
472 <pre><tt>Bisecting: 337 revisions left to test after this</tt></pre>
473 </div></div>
474 <div class="paragraph"><p>You keep repeating this process, compiling the tree, testing it, and
475 depending on whether it is good or bad issuing the command "git bisect good"
476 or "git bisect bad" to ask for the next bisection.</p></div>
477 <div class="paragraph"><p>Eventually there will be no more revisions left to bisect, and you
478 will have been left with the first bad kernel revision in "refs/bisect/bad".</p></div>
479 <h3 id="_bisect_reset">Bisect reset</h3><div style="clear:left"></div>
480 <div class="paragraph"><p>After a bisect session, to clean up the bisection state and return to
481 the original HEAD, issue the following command:</p></div>
482 <div class="listingblock">
483 <div class="content">
484 <pre><tt>$ git bisect reset</tt></pre>
485 </div></div>
486 <div class="paragraph"><p>By default, this will return your tree to the commit that was checked
487 out before <tt>git bisect start</tt>. (A new <tt>git bisect start</tt> will also do
488 that, as it cleans up the old bisection state.)</p></div>
489 <div class="paragraph"><p>With an optional argument, you can return to a different commit
490 instead:</p></div>
491 <div class="listingblock">
492 <div class="content">
493 <pre><tt>$ git bisect reset &lt;commit&gt;</tt></pre>
494 </div></div>
495 <div class="paragraph"><p>For example, <tt>git bisect reset HEAD</tt> will leave you on the current
496 bisection commit and avoid switching commits at all, while <tt>git bisect
497 reset bisect/bad</tt> will check out the first bad revision.</p></div>
498 <h3 id="_bisect_visualize">Bisect visualize</h3><div style="clear:left"></div>
499 <div class="paragraph"><p>To see the currently remaining suspects in <em>gitk</em>, issue the following
500 command during the bisection process:</p></div>
501 <div class="listingblock">
502 <div class="content">
503 <pre><tt>$ git bisect visualize</tt></pre>
504 </div></div>
505 <div class="paragraph"><p><tt>view</tt> may also be used as a synonym for <tt>visualize</tt>.</p></div>
506 <div class="paragraph"><p>If the <em>DISPLAY</em> environment variable is not set, <em>git log</em> is used
507 instead. You can also give command line options such as <tt>-p</tt> and
508 <tt>--stat</tt>.</p></div>
509 <div class="listingblock">
510 <div class="content">
511 <pre><tt>$ git bisect view --stat</tt></pre>
512 </div></div>
513 <h3 id="_bisect_log_and_bisect_replay">Bisect log and bisect replay</h3><div style="clear:left"></div>
514 <div class="paragraph"><p>After having marked revisions as good or bad, issue the following
515 command to show what has been done so far:</p></div>
516 <div class="listingblock">
517 <div class="content">
518 <pre><tt>$ git bisect log</tt></pre>
519 </div></div>
520 <div class="paragraph"><p>If you discover that you made a mistake in specifying the status of a
521 revision, you can save the output of this command to a file, edit it to
522 remove the incorrect entries, and then issue the following commands to
523 return to a corrected state:</p></div>
524 <div class="listingblock">
525 <div class="content">
526 <pre><tt>$ git bisect reset
527 $ git bisect replay that-file</tt></pre>
528 </div></div>
529 <h3 id="_avoiding_testing_a_commit">Avoiding testing a commit</h3><div style="clear:left"></div>
530 <div class="paragraph"><p>If, in the middle of a bisect session, you know that the next suggested
531 revision is not a good one to test (e.g. the change the commit
532 introduces is known not to work in your environment and you know it
533 does not have anything to do with the bug you are chasing), you may
534 want to find a nearby commit and try that instead.</p></div>
535 <div class="paragraph"><p>For example:</p></div>
536 <div class="listingblock">
537 <div class="content">
538 <pre><tt>$ git bisect good/bad # previous round was good or bad.
539 Bisecting: 337 revisions left to test after this
540 $ git bisect visualize # oops, that is uninteresting.
541 $ git reset --hard HEAD~3 # try 3 revisions before what
542 # was suggested</tt></pre>
543 </div></div>
544 <div class="paragraph"><p>Then compile and test the chosen revision, and afterwards mark
545 the revision as good or bad in the usual manner.</p></div>
546 <h3 id="_bisect_skip">Bisect skip</h3><div style="clear:left"></div>
547 <div class="paragraph"><p>Instead of choosing by yourself a nearby commit, you can ask git
548 to do it for you by issuing the command:</p></div>
549 <div class="listingblock">
550 <div class="content">
551 <pre><tt>$ git bisect skip # Current version cannot be tested</tt></pre>
552 </div></div>
553 <div class="paragraph"><p>But git may eventually be unable to tell the first bad commit among
554 a bad commit and one or more skipped commits.</p></div>
555 <div class="paragraph"><p>You can even skip a range of commits, instead of just one commit,
556 using the "<em>&lt;commit1&gt;</em>..<em>&lt;commit2&gt;</em>" notation. For example:</p></div>
557 <div class="listingblock">
558 <div class="content">
559 <pre><tt>$ git bisect skip v2.5..v2.6</tt></pre>
560 </div></div>
561 <div class="paragraph"><p>This tells the bisect process that no commit after <tt>v2.5</tt>, up to and
562 including <tt>v2.6</tt>, should be tested.</p></div>
563 <div class="paragraph"><p>Note that if you also want to skip the first commit of the range you
564 would issue the command:</p></div>
565 <div class="listingblock">
566 <div class="content">
567 <pre><tt>$ git bisect skip v2.5 v2.5..v2.6</tt></pre>
568 </div></div>
569 <div class="paragraph"><p>This tells the bisect process that the commits between <tt>v2.5</tt> included
570 and <tt>v2.6</tt> included should be skipped.</p></div>
571 <h3 id="_cutting_down_bisection_by_giving_more_parameters_to_bisect_start">Cutting down bisection by giving more parameters to bisect start</h3><div style="clear:left"></div>
572 <div class="paragraph"><p>You can further cut down the number of trials, if you know what part of
573 the tree is involved in the problem you are tracking down, by specifying
574 path parameters when issuing the <tt>bisect start</tt> command:</p></div>
575 <div class="listingblock">
576 <div class="content">
577 <pre><tt>$ git bisect start -- arch/i386 include/asm-i386</tt></pre>
578 </div></div>
579 <div class="paragraph"><p>If you know beforehand more than one good commit, you can narrow the
580 bisect space down by specifying all of the good commits immediately after
581 the bad commit when issuing the <tt>bisect start</tt> command:</p></div>
582 <div class="listingblock">
583 <div class="content">
584 <pre><tt>$ git bisect start v2.6.20-rc6 v2.6.20-rc4 v2.6.20-rc1 --
585 # v2.6.20-rc6 is bad
586 # v2.6.20-rc4 and v2.6.20-rc1 are good</tt></pre>
587 </div></div>
588 <h3 id="_bisect_run">Bisect run</h3><div style="clear:left"></div>
589 <div class="paragraph"><p>If you have a script that can tell if the current source code is good
590 or bad, you can bisect by issuing the command:</p></div>
591 <div class="listingblock">
592 <div class="content">
593 <pre><tt>$ git bisect run my_script arguments</tt></pre>
594 </div></div>
595 <div class="paragraph"><p>Note that the script (<tt>my_script</tt> in the above example) should
596 exit with code 0 if the current source code is good, and exit with a
597 code between 1 and 127 (inclusive), except 125, if the current
598 source code is bad.</p></div>
599 <div class="paragraph"><p>Any other exit code will abort the bisect process. It should be noted
600 that a program that terminates via "exit(-1)" leaves $? = 255, (see the
601 exit(3) manual page), as the value is chopped with "&amp; 0377".</p></div>
602 <div class="paragraph"><p>The special exit code 125 should be used when the current source code
603 cannot be tested. If the script exits with this code, the current
604 revision will be skipped (see <tt>git bisect skip</tt> above). 125 was chosen
605 as the highest sensible value to use for this purpose, because 126 and 127
606 are used by POSIX shells to signal specific error status (127 is for
607 command not found, 126 is for command found but not executable---these
608 details do not matter, as they are normal errors in the script, as far as
609 "bisect run" is concerned).</p></div>
610 <div class="paragraph"><p>You may often find that during a bisect session you want to have
611 temporary modifications (e.g. s/#define DEBUG 0/#define DEBUG 1/ in a
612 header file, or "revision that does not have this commit needs this
613 patch applied to work around another problem this bisection is not
614 interested in") applied to the revision being tested.</p></div>
615 <div class="paragraph"><p>To cope with such a situation, after the inner <em>git bisect</em> finds the
616 next revision to test, the script can apply the patch
617 before compiling, run the real test, and afterwards decide if the
618 revision (possibly with the needed patch) passed the test and then
619 rewind the tree to the pristine state. Finally the script should exit
620 with the status of the real test to let the "git bisect run" command loop
621 determine the eventual outcome of the bisect session.</p></div>
622 </div>
623 <h2 id="_options">OPTIONS</h2>
624 <div class="sectionbody">
625 <div class="dlist"><dl>
626 <dt class="hdlist1">
627 --no-checkout
628 </dt>
629 <dd>
630 <div class="paragraph"><p>Do not checkout the new working tree at each iteration of the bisection
631 process. Instead just update a special reference named <em>BISECT_HEAD</em> to make
632 it point to the commit that should be tested.</p></div>
633 <div class="paragraph"><p>This option may be useful when the test you would perform in each step
634 does not require a checked out tree.</p></div>
635 <div class="paragraph"><p>If the repository is bare, <tt>--no-checkout</tt> is assumed.</p></div>
636 </dd>
637 </dl></div>
638 </div>
639 <h2 id="_examples">EXAMPLES</h2>
640 <div class="sectionbody">
641 <div class="ulist"><ul>
642 <li>
644 Automatically bisect a broken build between v1.2 and HEAD:
645 </p>
646 <div class="listingblock">
647 <div class="content">
648 <pre><tt>$ git bisect start HEAD v1.2 -- # HEAD is bad, v1.2 is good
649 $ git bisect run make # "make" builds the app</tt></pre>
650 </div></div>
651 </li>
652 <li>
654 Automatically bisect a test failure between origin and HEAD:
655 </p>
656 <div class="listingblock">
657 <div class="content">
658 <pre><tt>$ git bisect start HEAD origin -- # HEAD is bad, origin is good
659 $ git bisect run make test # "make test" builds and tests</tt></pre>
660 </div></div>
661 </li>
662 <li>
664 Automatically bisect a broken test case:
665 </p>
666 <div class="listingblock">
667 <div class="content">
668 <pre><tt>$ cat ~/test.sh
669 #!/bin/sh
670 make || exit 125 # this skips broken builds
671 ~/check_test_case.sh # does the test case pass?
672 $ git bisect start HEAD HEAD~10 -- # culprit is among the last 10
673 $ git bisect run ~/test.sh</tt></pre>
674 </div></div>
675 <div class="paragraph"><p>Here we use a "test.sh" custom script. In this script, if "make"
676 fails, we skip the current commit.
677 "check_test_case.sh" should "exit 0" if the test case passes,
678 and "exit 1" otherwise.</p></div>
679 <div class="paragraph"><p>It is safer if both "test.sh" and "check_test_case.sh" are
680 outside the repository to prevent interactions between the bisect,
681 make and test processes and the scripts.</p></div>
682 </li>
683 <li>
685 Automatically bisect with temporary modifications (hot-fix):
686 </p>
687 <div class="listingblock">
688 <div class="content">
689 <pre><tt>$ cat ~/test.sh
690 #!/bin/sh
692 # tweak the working tree by merging the hot-fix branch
693 # and then attempt a build
694 if git merge --no-commit hot-fix &amp;&amp;
695 make
696 then
697 # run project specific test and report its status
698 ~/check_test_case.sh
699 status=$?
700 else
701 # tell the caller this is untestable
702 status=125
705 # undo the tweak to allow clean flipping to the next commit
706 git reset --hard
708 # return control
709 exit $status</tt></pre>
710 </div></div>
711 <div class="paragraph"><p>This applies modifications from a hot-fix branch before each test run,
712 e.g. in case your build or test environment changed so that older
713 revisions may need a fix which newer ones have already. (Make sure the
714 hot-fix branch is based off a commit which is contained in all revisions
715 which you are bisecting, so that the merge does not pull in too much, or
716 use <tt>git cherry-pick</tt> instead of <tt>git merge</tt>.)</p></div>
717 </li>
718 <li>
720 Automatically bisect a broken test case:
721 </p>
722 <div class="listingblock">
723 <div class="content">
724 <pre><tt>$ git bisect start HEAD HEAD~10 -- # culprit is among the last 10
725 $ git bisect run sh -c "make || exit 125; ~/check_test_case.sh"</tt></pre>
726 </div></div>
727 <div class="paragraph"><p>This shows that you can do without a run script if you write the test
728 on a single line.</p></div>
729 </li>
730 <li>
732 Locate a good region of the object graph in a damaged repository
733 </p>
734 <div class="listingblock">
735 <div class="content">
736 <pre><tt>$ git bisect start HEAD &lt;known-good-commit&gt; [ &lt;boundary-commit&gt; ... ] --no-checkout
737 $ git bisect run sh -c '
738 GOOD=$(git for-each-ref "--format=%(objectname)" refs/bisect/good-*) &amp;&amp;
739 git rev-list --objects BISECT_HEAD --not $GOOD &gt;tmp.$$ &amp;&amp;
740 git pack-objects --stdout &gt;/dev/null &lt;tmp.$$
741 rc=$?
742 rm -f tmp.$$
743 test $rc = 0'</tt></pre>
744 </div></div>
745 <div class="paragraph"><p>In this case, when <em>git bisect run</em> finishes, bisect/bad will refer to a commit that
746 has at least one parent whose reachable graph is fully traversable in the sense
747 required by <em>git pack objects</em>.</p></div>
748 </li>
749 </ul></div>
750 </div>
751 <h2 id="_see_also">SEE ALSO</h2>
752 <div class="sectionbody">
753 <div class="paragraph"><p><a href="git-bisect-lk2009.html">Fighting regressions with git bisect</a>,
754 <a href="git-blame.html">git-blame(1)</a>.</p></div>
755 </div>
756 <h2 id="_git">GIT</h2>
757 <div class="sectionbody">
758 <div class="paragraph"><p>Part of the <a href="git.html">git(1)</a> suite</p></div>
759 </div>
760 <div id="footer">
761 <div id="footer-text">
762 Last updated 2011-08-18 06:09:28 UTC
763 </div>
764 </div>
765 </body>
766 </html>