blob: ba82d41d2d2682e3addb55b41eec883948644576 [file] [log] [blame]
Junio C Hamano1a4e8412005-12-27 08:17:231<!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>
Junio C Hamano9d971152012-12-19 00:43:115<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8" />
Junio C Hamanoc14e6ad2014-10-31 20:25:536<meta name="generator" content="AsciiDoc 8.6.9" />
Junio C Hamano103b5722011-01-31 05:03:457<title>git-bisect(1)</title>
Junio C Hamano1a4e8412005-12-27 08:17:238<style type="text/css">
Junio C Hamano9d971152012-12-19 00:43:119/* Shared CSS for AsciiDoc xhtml11 and html5 backends */
10
11/* Default font. */
12body {
13 font-family: Georgia,serif;
14}
15
16/* Title font. */
17h1, h2, h3, h4, h5, h6,
18div.title, caption.title,
19thead, p.table.header,
20#toctitle,
21#author, #revnumber, #revdate, #revremark,
22#footer {
23 font-family: Arial,Helvetica,sans-serif;
Junio C Hamano1a4e8412005-12-27 08:17:2324}
25
26body {
27 margin: 1em 5% 1em 5%;
28}
29
Junio C Hamanoba4b9282008-07-06 05:20:3130a {
31 color: blue;
32 text-decoration: underline;
33}
34a:visited {
35 color: fuchsia;
36}
Junio C Hamano1a4e8412005-12-27 08:17:2337
38em {
39 font-style: italic;
Junio C Hamano103b5722011-01-31 05:03:4540 color: navy;
Junio C Hamano1a4e8412005-12-27 08:17:2341}
42
43strong {
44 font-weight: bold;
Junio C Hamano103b5722011-01-31 05:03:4545 color: #083194;
Junio C Hamano1a4e8412005-12-27 08:17:2346}
47
Junio C Hamano1a4e8412005-12-27 08:17:2348h1, h2, h3, h4, h5, h6 {
49 color: #527bbd;
Junio C Hamano1a4e8412005-12-27 08:17:2350 margin-top: 1.2em;
51 margin-bottom: 0.5em;
52 line-height: 1.3;
53}
54
Junio C Hamanoba4b9282008-07-06 05:20:3155h1, h2, h3 {
Junio C Hamano1a4e8412005-12-27 08:17:2356 border-bottom: 2px solid silver;
57}
58h2 {
Junio C Hamano1a4e8412005-12-27 08:17:2359 padding-top: 0.5em;
60}
Junio C Hamanoba4b9282008-07-06 05:20:3161h3 {
62 float: left;
63}
64h3 + * {
65 clear: left;
66}
Junio C Hamano9d971152012-12-19 00:43:1167h5 {
68 font-size: 1.0em;
69}
Junio C Hamano1a4e8412005-12-27 08:17:2370
71div.sectionbody {
Junio C Hamano1a4e8412005-12-27 08:17:2372 margin-left: 0;
73}
74
75hr {
76 border: 1px solid silver;
77}
78
79p {
80 margin-top: 0.5em;
81 margin-bottom: 0.5em;
82}
83
Junio C Hamano103b5722011-01-31 05:03:4584ul, ol, li > p {
85 margin-top: 0;
86}
Junio C Hamano9d971152012-12-19 00:43:1187ul > li { color: #aaa; }
88ul > li > * { color: black; }
Junio C Hamano103b5722011-01-31 05:03:4589
Junio C Hamanoc14e6ad2014-10-31 20:25:5390.monospaced, code, pre {
91 font-family: "Courier New", Courier, monospace;
92 font-size: inherit;
93 color: navy;
Junio C Hamano1a4e8412005-12-27 08:17:2394 padding: 0;
95 margin: 0;
96}
Junio C Hamanoc14e6ad2014-10-31 20:25:5397pre {
98 white-space: pre-wrap;
99}
Junio C Hamano1a4e8412005-12-27 08:17:23100
Junio C Hamano9d971152012-12-19 00:43:11101#author {
Junio C Hamano1a4e8412005-12-27 08:17:23102 color: #527bbd;
Junio C Hamano1a4e8412005-12-27 08:17:23103 font-weight: bold;
Junio C Hamanoba4b9282008-07-06 05:20:31104 font-size: 1.1em;
Junio C Hamano1a4e8412005-12-27 08:17:23105}
Junio C Hamano9d971152012-12-19 00:43:11106#email {
Junio C Hamano1a4e8412005-12-27 08:17:23107}
Junio C Hamano9d971152012-12-19 00:43:11108#revnumber, #revdate, #revremark {
Junio C Hamano1a4e8412005-12-27 08:17:23109}
110
Junio C Hamano9d971152012-12-19 00:43:11111#footer {
Junio C Hamano1a4e8412005-12-27 08:17:23112 font-size: small;
113 border-top: 2px solid silver;
114 padding-top: 0.5em;
115 margin-top: 4.0em;
116}
Junio C Hamano9d971152012-12-19 00:43:11117#footer-text {
Junio C Hamano1a4e8412005-12-27 08:17:23118 float: left;
119 padding-bottom: 0.5em;
120}
Junio C Hamano9d971152012-12-19 00:43:11121#footer-badges {
Junio C Hamano1a4e8412005-12-27 08:17:23122 float: right;
123 padding-bottom: 0.5em;
124}
125
Junio C Hamano9d971152012-12-19 00:43:11126#preamble {
Junio C Hamano103b5722011-01-31 05:03:45127 margin-top: 1.5em;
128 margin-bottom: 1.5em;
129}
Junio C Hamano9d971152012-12-19 00:43:11130div.imageblock, div.exampleblock, div.verseblock,
Junio C Hamano1a4e8412005-12-27 08:17:23131div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock,
132div.admonitionblock {
Junio C Hamano7bd050f2011-09-22 06:32:22133 margin-top: 1.0em;
Junio C Hamano1a4e8412005-12-27 08:17:23134 margin-bottom: 1.5em;
135}
136div.admonitionblock {
Junio C Hamano7bd050f2011-09-22 06:32:22137 margin-top: 2.0em;
138 margin-bottom: 2.0em;
139 margin-right: 10%;
140 color: #606060;
Junio C Hamano1a4e8412005-12-27 08:17:23141}
142
143div.content { /* Block element content. */
144 padding: 0;
145}
146
147/* Block element titles. */
148div.title, caption.title {
Junio C Hamano103b5722011-01-31 05:03:45149 color: #527bbd;
Junio C Hamano1a4e8412005-12-27 08:17:23150 font-weight: bold;
151 text-align: left;
152 margin-top: 1.0em;
153 margin-bottom: 0.5em;
154}
155div.title + * {
156 margin-top: 0;
157}
158
159td div.title:first-child {
160 margin-top: 0.0em;
161}
162div.content div.title:first-child {
163 margin-top: 0.0em;
164}
165div.content + div.title {
166 margin-top: 0.0em;
167}
168
169div.sidebarblock > div.content {
170 background: #ffffee;
Junio C Hamano9d971152012-12-19 00:43:11171 border: 1px solid #dddddd;
172 border-left: 4px solid #f0f0f0;
Junio C Hamano1a4e8412005-12-27 08:17:23173 padding: 0.5em;
174}
175
176div.listingblock > div.content {
Junio C Hamano9d971152012-12-19 00:43:11177 border: 1px solid #dddddd;
178 border-left: 5px solid #f0f0f0;
179 background: #f8f8f8;
Junio C Hamano1a4e8412005-12-27 08:17:23180 padding: 0.5em;
181}
182
Junio C Hamano7bd050f2011-09-22 06:32:22183div.quoteblock, div.verseblock {
184 padding-left: 1.0em;
185 margin-left: 1.0em;
Junio C Hamano103b5722011-01-31 05:03:45186 margin-right: 10%;
Junio C Hamano9d971152012-12-19 00:43:11187 border-left: 5px solid #f0f0f0;
188 color: #888;
Junio C Hamano1a4e8412005-12-27 08:17:23189}
Junio C Hamano7bd050f2011-09-22 06:32:22190
Junio C Hamano103b5722011-01-31 05:03:45191div.quoteblock > div.attribution {
192 padding-top: 0.5em;
Junio C Hamano1a4e8412005-12-27 08:17:23193 text-align: right;
194}
Junio C Hamano103b5722011-01-31 05:03:45195
Junio C Hamano9d971152012-12-19 00:43:11196div.verseblock > pre.content {
197 font-family: inherit;
198 font-size: inherit;
Junio C Hamano103b5722011-01-31 05:03:45199}
200div.verseblock > div.attribution {
201 padding-top: 0.75em;
202 text-align: left;
203}
204/* DEPRECATED: Pre version 8.2.7 verse style literal block. */
Junio C Hamanoba4b9282008-07-06 05:20:31205div.verseblock + div.attribution {
206 text-align: left;
207}
Junio C Hamano1a4e8412005-12-27 08:17:23208
209div.admonitionblock .icon {
210 vertical-align: top;
211 font-size: 1.1em;
212 font-weight: bold;
213 text-decoration: underline;
214 color: #527bbd;
215 padding-right: 0.5em;
216}
217div.admonitionblock td.content {
218 padding-left: 0.5em;
Junio C Hamano7bd050f2011-09-22 06:32:22219 border-left: 3px solid #dddddd;
Junio C Hamano1a4e8412005-12-27 08:17:23220}
221
222div.exampleblock > div.content {
Junio C Hamano7bd050f2011-09-22 06:32:22223 border-left: 3px solid #dddddd;
224 padding-left: 0.5em;
Junio C Hamano1a4e8412005-12-27 08:17:23225}
226
Junio C Hamano1a4e8412005-12-27 08:17:23227div.imageblock div.content { padding-left: 0; }
Junio C Hamanoc14e6ad2014-10-31 20:25:53228span.image img { border-style: none; vertical-align: text-bottom; }
Junio C Hamano103b5722011-01-31 05:03:45229a.image:visited { color: white; }
Junio C Hamano1a4e8412005-12-27 08:17:23230
231dl {
232 margin-top: 0.8em;
233 margin-bottom: 0.8em;
234}
235dt {
236 margin-top: 0.5em;
237 margin-bottom: 0;
Junio C Hamano103b5722011-01-31 05:03:45238 font-style: normal;
239 color: navy;
Junio C Hamano1a4e8412005-12-27 08:17:23240}
241dd > *:first-child {
Junio C Hamano103b5722011-01-31 05:03:45242 margin-top: 0.1em;
Junio C Hamano1a4e8412005-12-27 08:17:23243}
244
245ul, ol {
246 list-style-position: outside;
247}
Junio C Hamano103b5722011-01-31 05:03:45248ol.arabic {
249 list-style-type: decimal;
250}
251ol.loweralpha {
Junio C Hamano1a4e8412005-12-27 08:17:23252 list-style-type: lower-alpha;
253}
Junio C Hamano103b5722011-01-31 05:03:45254ol.upperalpha {
255 list-style-type: upper-alpha;
256}
257ol.lowerroman {
258 list-style-type: lower-roman;
259}
260ol.upperroman {
261 list-style-type: upper-roman;
262}
263
264div.compact ul, div.compact ol,
265div.compact p, div.compact p,
266div.compact div, div.compact div {
267 margin-top: 0.1em;
268 margin-bottom: 0.1em;
269}
Junio C Hamano1a4e8412005-12-27 08:17:23270
Junio C Hamano1a4e8412005-12-27 08:17:23271tfoot {
272 font-weight: bold;
273}
Junio C Hamano103b5722011-01-31 05:03:45274td > div.verse {
275 white-space: pre;
276}
Junio C Hamano103b5722011-01-31 05:03:45277
278div.hdlist {
Junio C Hamano1a4e8412005-12-27 08:17:23279 margin-top: 0.8em;
280 margin-bottom: 0.8em;
281}
Junio C Hamano103b5722011-01-31 05:03:45282div.hdlist tr {
283 padding-bottom: 15px;
Junio C Hamanoba4b9282008-07-06 05:20:31284}
Junio C Hamano103b5722011-01-31 05:03:45285dt.hdlist1.strong, td.hdlist1.strong {
286 font-weight: bold;
287}
288td.hdlist1 {
Junio C Hamano1a4e8412005-12-27 08:17:23289 vertical-align: top;
Junio C Hamano103b5722011-01-31 05:03:45290 font-style: normal;
Junio C Hamano1a4e8412005-12-27 08:17:23291 padding-right: 0.8em;
Junio C Hamano103b5722011-01-31 05:03:45292 color: navy;
Junio C Hamano1a4e8412005-12-27 08:17:23293}
Junio C Hamano103b5722011-01-31 05:03:45294td.hdlist2 {
Junio C Hamano1a4e8412005-12-27 08:17:23295 vertical-align: top;
296}
Junio C Hamano103b5722011-01-31 05:03:45297div.hdlist.compact tr {
298 margin: 0;
299 padding-bottom: 0;
300}
301
302.comment {
303 background: yellow;
304}
Junio C Hamano1a4e8412005-12-27 08:17:23305
Junio C Hamano7bd050f2011-09-22 06:32:22306.footnote, .footnoteref {
307 font-size: 0.8em;
308}
309
310span.footnote, span.footnoteref {
311 vertical-align: super;
312}
313
314#footnotes {
315 margin: 20px 0 20px 0;
316 padding: 7px 0 0 0;
317}
318
319#footnotes div.footnote {
320 margin: 0 0 5px 0;
321}
322
323#footnotes hr {
324 border: none;
325 border-top: 1px solid silver;
326 height: 1px;
327 text-align: left;
328 margin-left: 0;
329 width: 20%;
330 min-width: 100px;
331}
332
Junio C Hamano9d971152012-12-19 00:43:11333div.colist td {
334 padding-right: 0.5em;
335 padding-bottom: 0.3em;
336 vertical-align: top;
337}
338div.colist td img {
339 margin-top: 0.3em;
Junio C Hamano1a4e8412005-12-27 08:17:23340}
Junio C Hamanoba4b9282008-07-06 05:20:31341
Junio C Hamano9d971152012-12-19 00:43:11342@media print {
343 #footer-badges { display: none; }
344}
345
346#toc {
Junio C Hamano7bd050f2011-09-22 06:32:22347 margin-bottom: 2.5em;
348}
349
Junio C Hamano9d971152012-12-19 00:43:11350#toctitle {
Junio C Hamanoba4b9282008-07-06 05:20:31351 color: #527bbd;
Junio C Hamanoba4b9282008-07-06 05:20:31352 font-size: 1.1em;
353 font-weight: bold;
354 margin-top: 1.0em;
355 margin-bottom: 0.1em;
356}
357
Junio C Hamanoc14e6ad2014-10-31 20:25:53358div.toclevel0, div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 {
Junio C Hamanoba4b9282008-07-06 05:20:31359 margin-top: 0;
360 margin-bottom: 0;
361}
362div.toclevel2 {
363 margin-left: 2em;
364 font-size: 0.9em;
365}
366div.toclevel3 {
367 margin-left: 4em;
368 font-size: 0.9em;
369}
370div.toclevel4 {
371 margin-left: 6em;
372 font-size: 0.9em;
373}
Junio C Hamano9d971152012-12-19 00:43:11374
375span.aqua { color: aqua; }
376span.black { color: black; }
377span.blue { color: blue; }
378span.fuchsia { color: fuchsia; }
379span.gray { color: gray; }
380span.green { color: green; }
381span.lime { color: lime; }
382span.maroon { color: maroon; }
383span.navy { color: navy; }
384span.olive { color: olive; }
385span.purple { color: purple; }
386span.red { color: red; }
387span.silver { color: silver; }
388span.teal { color: teal; }
389span.white { color: white; }
390span.yellow { color: yellow; }
391
392span.aqua-background { background: aqua; }
393span.black-background { background: black; }
394span.blue-background { background: blue; }
395span.fuchsia-background { background: fuchsia; }
396span.gray-background { background: gray; }
397span.green-background { background: green; }
398span.lime-background { background: lime; }
399span.maroon-background { background: maroon; }
400span.navy-background { background: navy; }
401span.olive-background { background: olive; }
402span.purple-background { background: purple; }
403span.red-background { background: red; }
404span.silver-background { background: silver; }
405span.teal-background { background: teal; }
406span.white-background { background: white; }
407span.yellow-background { background: yellow; }
408
409span.big { font-size: 2em; }
410span.small { font-size: 0.6em; }
411
412span.underline { text-decoration: underline; }
413span.overline { text-decoration: overline; }
414span.line-through { text-decoration: line-through; }
415
Junio C Hamanoc14e6ad2014-10-31 20:25:53416div.unbreakable { page-break-inside: avoid; }
417
Junio C Hamano9d971152012-12-19 00:43:11418
419/*
420 * xhtml11 specific
421 *
422 * */
423
424div.tableblock {
425 margin-top: 1.0em;
426 margin-bottom: 1.5em;
427}
428div.tableblock > table {
429 border: 3px solid #527bbd;
430}
431thead, p.table.header {
432 font-weight: bold;
433 color: #527bbd;
434}
435p.table {
436 margin-top: 0;
437}
438/* Because the table frame attribute is overriden by CSS in most browsers. */
439div.tableblock > table[frame="void"] {
440 border-style: none;
441}
442div.tableblock > table[frame="hsides"] {
443 border-left-style: none;
444 border-right-style: none;
445}
446div.tableblock > table[frame="vsides"] {
447 border-top-style: none;
448 border-bottom-style: none;
449}
450
451
452/*
453 * html5 specific
454 *
455 * */
456
457table.tableblock {
458 margin-top: 1.0em;
459 margin-bottom: 1.5em;
460}
461thead, p.tableblock.header {
462 font-weight: bold;
463 color: #527bbd;
464}
465p.tableblock {
466 margin-top: 0;
467}
468table.tableblock {
469 border-width: 3px;
470 border-spacing: 0px;
471 border-style: solid;
472 border-color: #527bbd;
473 border-collapse: collapse;
474}
475th.tableblock, td.tableblock {
476 border-width: 1px;
477 padding: 4px;
478 border-style: solid;
479 border-color: #527bbd;
480}
481
482table.tableblock.frame-topbot {
483 border-left-style: hidden;
484 border-right-style: hidden;
485}
486table.tableblock.frame-sides {
487 border-top-style: hidden;
488 border-bottom-style: hidden;
489}
490table.tableblock.frame-none {
491 border-style: hidden;
492}
493
494th.tableblock.halign-left, td.tableblock.halign-left {
495 text-align: left;
496}
497th.tableblock.halign-center, td.tableblock.halign-center {
498 text-align: center;
499}
500th.tableblock.halign-right, td.tableblock.halign-right {
501 text-align: right;
502}
503
504th.tableblock.valign-top, td.tableblock.valign-top {
505 vertical-align: top;
506}
507th.tableblock.valign-middle, td.tableblock.valign-middle {
508 vertical-align: middle;
509}
510th.tableblock.valign-bottom, td.tableblock.valign-bottom {
511 vertical-align: bottom;
512}
513
514
515/*
516 * manpage specific
517 *
518 * */
519
520body.manpage h1 {
Junio C Hamano103b5722011-01-31 05:03:45521 padding-top: 0.5em;
522 padding-bottom: 0.5em;
523 border-top: 2px solid silver;
524 border-bottom: 2px solid silver;
525}
Junio C Hamano9d971152012-12-19 00:43:11526body.manpage h2 {
Junio C Hamano103b5722011-01-31 05:03:45527 border-style: none;
528}
Junio C Hamano9d971152012-12-19 00:43:11529body.manpage div.sectionbody {
530 margin-left: 3em;
Junio C Hamano103b5722011-01-31 05:03:45531}
532
533@media print {
Junio C Hamano9d971152012-12-19 00:43:11534 body.manpage div#toc { display: none; }
Junio C Hamano103b5722011-01-31 05:03:45535}
Junio C Hamanoc14e6ad2014-10-31 20:25:53536
537
Junio C Hamano1a4e8412005-12-27 08:17:23538</style>
Junio C Hamano7bd050f2011-09-22 06:32:22539<script type="text/javascript">
540/*<![CDATA[*/
Junio C Hamano7bd050f2011-09-22 06:32:22541var asciidoc = { // Namespace.
542
543/////////////////////////////////////////////////////////////////////
544// Table Of Contents generator
545/////////////////////////////////////////////////////////////////////
546
547/* Author: Mihai Bazon, September 2002
548 * http://students.infoiasi.ro/~mishoo
549 *
550 * Table Of Content generator
551 * Version: 0.4
552 *
553 * Feel free to use this script under the terms of the GNU General Public
554 * License, as long as you do not remove or alter this notice.
555 */
556
557 /* modified by Troy D. Hanson, September 2006. License: GPL */
558 /* modified by Stuart Rackham, 2006, 2009. License: GPL */
559
560// toclevels = 1..4.
561toc: function (toclevels) {
562
563 function getText(el) {
564 var text = "";
565 for (var i = el.firstChild; i != null; i = i.nextSibling) {
566 if (i.nodeType == 3 /* Node.TEXT_NODE */) // IE doesn't speak constants.
567 text += i.data;
568 else if (i.firstChild != null)
569 text += getText(i);
570 }
571 return text;
572 }
573
574 function TocEntry(el, text, toclevel) {
575 this.element = el;
576 this.text = text;
577 this.toclevel = toclevel;
578 }
579
580 function tocEntries(el, toclevels) {
581 var result = new Array;
Junio C Hamanoc14e6ad2014-10-31 20:25:53582 var re = new RegExp('[hH]([1-'+(toclevels+1)+'])');
Junio C Hamano7bd050f2011-09-22 06:32:22583 // Function that scans the DOM tree for header elements (the DOM2
584 // nodeIterator API would be a better technique but not supported by all
585 // browsers).
586 var iterate = function (el) {
587 for (var i = el.firstChild; i != null; i = i.nextSibling) {
588 if (i.nodeType == 1 /* Node.ELEMENT_NODE */) {
589 var mo = re.exec(i.tagName);
590 if (mo && (i.getAttribute("class") || i.getAttribute("className")) != "float") {
591 result[result.length] = new TocEntry(i, getText(i), mo[1]-1);
592 }
593 iterate(i);
594 }
595 }
596 }
597 iterate(el);
598 return result;
599 }
600
601 var toc = document.getElementById("toc");
Junio C Hamano9d971152012-12-19 00:43:11602 if (!toc) {
603 return;
604 }
605
606 // Delete existing TOC entries in case we're reloading the TOC.
607 var tocEntriesToRemove = [];
608 var i;
609 for (i = 0; i < toc.childNodes.length; i++) {
610 var entry = toc.childNodes[i];
Junio C Hamanoc14e6ad2014-10-31 20:25:53611 if (entry.nodeName.toLowerCase() == 'div'
Junio C Hamano9d971152012-12-19 00:43:11612 && entry.getAttribute("class")
613 && entry.getAttribute("class").match(/^toclevel/))
614 tocEntriesToRemove.push(entry);
615 }
616 for (i = 0; i < tocEntriesToRemove.length; i++) {
617 toc.removeChild(tocEntriesToRemove[i]);
618 }
619
620 // Rebuild TOC entries.
Junio C Hamano7bd050f2011-09-22 06:32:22621 var entries = tocEntries(document.getElementById("content"), toclevels);
622 for (var i = 0; i < entries.length; ++i) {
623 var entry = entries[i];
624 if (entry.element.id == "")
625 entry.element.id = "_toc_" + i;
626 var a = document.createElement("a");
627 a.href = "#" + entry.element.id;
628 a.appendChild(document.createTextNode(entry.text));
629 var div = document.createElement("div");
630 div.appendChild(a);
631 div.className = "toclevel" + entry.toclevel;
632 toc.appendChild(div);
633 }
634 if (entries.length == 0)
635 toc.parentNode.removeChild(toc);
636},
637
638
639/////////////////////////////////////////////////////////////////////
640// Footnotes generator
641/////////////////////////////////////////////////////////////////////
642
643/* Based on footnote generation code from:
644 * http://www.brandspankingnew.net/archive/2005/07/format_footnote.html
645 */
646
647footnotes: function () {
Junio C Hamano9d971152012-12-19 00:43:11648 // Delete existing footnote entries in case we're reloading the footnodes.
649 var i;
Junio C Hamano7bd050f2011-09-22 06:32:22650 var noteholder = document.getElementById("footnotes");
Junio C Hamano9d971152012-12-19 00:43:11651 if (!noteholder) {
652 return;
653 }
654 var entriesToRemove = [];
655 for (i = 0; i < noteholder.childNodes.length; i++) {
656 var entry = noteholder.childNodes[i];
Junio C Hamanoc14e6ad2014-10-31 20:25:53657 if (entry.nodeName.toLowerCase() == 'div' && entry.getAttribute("class") == "footnote")
Junio C Hamano9d971152012-12-19 00:43:11658 entriesToRemove.push(entry);
659 }
660 for (i = 0; i < entriesToRemove.length; i++) {
661 noteholder.removeChild(entriesToRemove[i]);
662 }
663
664 // Rebuild footnote entries.
665 var cont = document.getElementById("content");
Junio C Hamano7bd050f2011-09-22 06:32:22666 var spans = cont.getElementsByTagName("span");
667 var refs = {};
668 var n = 0;
669 for (i=0; i<spans.length; i++) {
670 if (spans[i].className == "footnote") {
671 n++;
Junio C Hamano9d971152012-12-19 00:43:11672 var note = spans[i].getAttribute("data-note");
673 if (!note) {
674 // Use [\s\S] in place of . so multi-line matches work.
675 // Because JavaScript has no s (dotall) regex flag.
676 note = spans[i].innerHTML.match(/\s*\[([\s\S]*)]\s*/)[1];
677 spans[i].innerHTML =
678 "[<a id='_footnoteref_" + n + "' href='#_footnote_" + n +
679 "' title='View footnote' class='footnote'>" + n + "</a>]";
680 spans[i].setAttribute("data-note", note);
681 }
Junio C Hamano7bd050f2011-09-22 06:32:22682 noteholder.innerHTML +=
683 "<div class='footnote' id='_footnote_" + n + "'>" +
684 "<a href='#_footnoteref_" + n + "' title='Return to text'>" +
685 n + "</a>. " + note + "</div>";
Junio C Hamano7bd050f2011-09-22 06:32:22686 var id =spans[i].getAttribute("id");
687 if (id != null) refs["#"+id] = n;
688 }
689 }
690 if (n == 0)
691 noteholder.parentNode.removeChild(noteholder);
692 else {
693 // Process footnoterefs.
694 for (i=0; i<spans.length; i++) {
695 if (spans[i].className == "footnoteref") {
696 var href = spans[i].getElementsByTagName("a")[0].getAttribute("href");
697 href = href.match(/#.*/)[0]; // Because IE return full URL.
698 n = refs[href];
699 spans[i].innerHTML =
700 "[<a href='#_footnote_" + n +
701 "' title='View footnote' class='footnote'>" + n + "</a>]";
702 }
703 }
704 }
Junio C Hamano9d971152012-12-19 00:43:11705},
706
707install: function(toclevels) {
708 var timerId;
709
710 function reinstall() {
711 asciidoc.footnotes();
712 if (toclevels) {
713 asciidoc.toc(toclevels);
714 }
715 }
716
717 function reinstallAndRemoveTimer() {
718 clearInterval(timerId);
719 reinstall();
720 }
721
722 timerId = setInterval(reinstall, 500);
723 if (document.addEventListener)
724 document.addEventListener("DOMContentLoaded", reinstallAndRemoveTimer, false);
725 else
726 window.onload = reinstallAndRemoveTimer;
Junio C Hamano7bd050f2011-09-22 06:32:22727}
728
729}
Junio C Hamano9d971152012-12-19 00:43:11730asciidoc.install();
Junio C Hamano7bd050f2011-09-22 06:32:22731/*]]>*/
732</script>
Junio C Hamano1a4e8412005-12-27 08:17:23733</head>
Junio C Hamano9d971152012-12-19 00:43:11734<body class="manpage">
Junio C Hamano1a4e8412005-12-27 08:17:23735<div id="header">
736<h1>
737git-bisect(1) Manual Page
738</h1>
739<h2>NAME</h2>
740<div class="sectionbody">
741<p>git-bisect -
Junio C Hamano9c512872015-08-12 21:59:25742 Use binary search to find the commit that introduced a bug
Junio C Hamano1a4e8412005-12-27 08:17:23743</p>
744</div>
745</div>
Junio C Hamano7bd050f2011-09-22 06:32:22746<div id="content">
Junio C Hamano9d971152012-12-19 00:43:11747<div class="sect1">
Junio C Hamano103b5722011-01-31 05:03:45748<h2 id="_synopsis">SYNOPSIS</h2>
Junio C Hamano1a4e8412005-12-27 08:17:23749<div class="sectionbody">
Junio C Hamano15567bc2011-07-23 00:51:59750<div class="verseblock">
Junio C Hamano9d971152012-12-19 00:43:11751<pre class="content"><em>git bisect</em> &lt;subcommand&gt; &lt;options&gt;</pre>
752<div class="attribution">
Junio C Hamano15567bc2011-07-23 00:51:59753</div></div>
Junio C Hamano1a4e8412005-12-27 08:17:23754</div>
Junio C Hamano9d971152012-12-19 00:43:11755</div>
756<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:31757<h2 id="_description">DESCRIPTION</h2>
Junio C Hamano1a4e8412005-12-27 08:17:23758<div class="sectionbody">
Junio C Hamano103b5722011-01-31 05:03:45759<div class="paragraph"><p>The command takes various subcommands, and different options depending
Junio C Hamanoba4b9282008-07-06 05:20:31760on the subcommand:</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:23761<div class="literalblock">
762<div class="content">
Junio C Hamano1eb56092015-10-05 20:39:53763<pre><code>git bisect start [--term-{old,good}=&lt;term&gt; --term-{new,bad}=&lt;term&gt;]
764 [--no-checkout] [&lt;bad&gt; [&lt;good&gt;...]] [--] [&lt;paths&gt;...]
Junio C Hamanobcd98f42017-01-24 00:12:16765git bisect (bad|new|&lt;term-new&gt;) [&lt;rev&gt;]
766git bisect (good|old|&lt;term-old&gt;) [&lt;rev&gt;...]
Junio C Hamano1eb56092015-10-05 20:39:53767git bisect terms [--term-good | --term-bad]
Junio C Hamanod796cea2008-12-03 03:51:10768git bisect skip [(&lt;rev&gt;|&lt;range&gt;)...]
Junio C Hamanoc21ab052009-10-31 04:03:55769git bisect reset [&lt;commit&gt;]
Junio C Hamanob72f6032017-11-15 05:57:08770git bisect (visualize|view)
Junio C Hamano1a4e8412005-12-27 08:17:23771git bisect replay &lt;logfile&gt;
Junio C Hamanof440a232007-03-23 10:46:17772git bisect log
Junio C Hamano9c512872015-08-12 21:59:25773git bisect run &lt;cmd&gt;...
774git bisect help</code></pre>
Junio C Hamano1a4e8412005-12-27 08:17:23775</div></div>
Junio C Hamano9c512872015-08-12 21:59:25776<div class="paragraph"><p>This command uses a binary search algorithm to find which commit in
777your project&#8217;s history introduced a bug. You use it by first telling
778it a "bad" commit that is known to contain the bug, and a "good"
779commit that is known to be before the bug was introduced. Then <code>git
780bisect</code> picks a commit between those two endpoints and asks you
781whether the selected commit is "good" or "bad". It continues narrowing
782down the range until it finds the exact commit that introduced the
783change.</p></div>
Junio C Hamano1eb56092015-10-05 20:39:53784<div class="paragraph"><p>In fact, <code>git bisect</code> can be used to find the commit that changed
785<strong>any</strong> property of your project; e.g., the commit that fixed a bug, or
786the commit that caused a benchmark&#8217;s performance to improve. To
787support this more general usage, the terms "old" and "new" can be used
788in place of "good" and "bad", or you can choose your own terms. See
789section "Alternate terms" below for more information.</p></div>
Junio C Hamano9d971152012-12-19 00:43:11790<div class="sect2">
791<h3 id="_basic_bisect_commands_start_bad_good">Basic bisect commands: start, bad, good</h3>
Junio C Hamano9c512872015-08-12 21:59:25792<div class="paragraph"><p>As an example, suppose you are trying to find the commit that broke a
793feature that was known to work in version <code>v2.6.13-rc2</code> of your
794project. You start a bisect session as follows:</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:23795<div class="listingblock">
796<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:53797<pre><code>$ git bisect start
Junio C Hamanob60308a2007-03-24 07:16:42798$ git bisect bad # Current version is bad
Junio C Hamano9c512872015-08-12 21:59:25799$ git bisect good v2.6.13-rc2 # v2.6.13-rc2 is known to be good</code></pre>
Junio C Hamano1a4e8412005-12-27 08:17:23800</div></div>
Junio C Hamano9c512872015-08-12 21:59:25801<div class="paragraph"><p>Once you have specified at least one bad and one good commit, <code>git
802bisect</code> selects a commit in the middle of that range of history,
803checks it out, and outputs something similar to the following:</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:23804<div class="listingblock">
805<div class="content">
Junio C Hamano9c512872015-08-12 21:59:25806<pre><code>Bisecting: 675 revisions left to test after this (roughly 10 steps)</code></pre>
Junio C Hamano1a4e8412005-12-27 08:17:23807</div></div>
Junio C Hamano9c512872015-08-12 21:59:25808<div class="paragraph"><p>You should now compile the checked-out version and test it. If that
809version works correctly, type</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:23810<div class="listingblock">
811<div class="content">
Junio C Hamano9c512872015-08-12 21:59:25812<pre><code>$ git bisect good</code></pre>
Junio C Hamano1a4e8412005-12-27 08:17:23813</div></div>
Junio C Hamano9c512872015-08-12 21:59:25814<div class="paragraph"><p>If that version is broken, type</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:23815<div class="listingblock">
816<div class="content">
Junio C Hamano9c512872015-08-12 21:59:25817<pre><code>$ git bisect bad</code></pre>
Junio C Hamano1a4e8412005-12-27 08:17:23818</div></div>
Junio C Hamano9c512872015-08-12 21:59:25819<div class="paragraph"><p>Then <code>git bisect</code> will respond with something like</p></div>
820<div class="listingblock">
821<div class="content">
822<pre><code>Bisecting: 337 revisions left to test after this (roughly 9 steps)</code></pre>
823</div></div>
824<div class="paragraph"><p>Keep repeating the process: compile the tree, test it, and depending
825on whether it is good or bad run <code>git bisect good</code> or <code>git bisect bad</code>
826to ask for the next commit that needs testing.</p></div>
827<div class="paragraph"><p>Eventually there will be no more revisions left to inspect, and the
828command will print out a description of the first bad commit. The
829reference <code>refs/bisect/bad</code> will be left pointing at that commit.</p></div>
Junio C Hamano9d971152012-12-19 00:43:11830</div>
831<div class="sect2">
832<h3 id="_bisect_reset">Bisect reset</h3>
Junio C Hamano103b5722011-01-31 05:03:45833<div class="paragraph"><p>After a bisect session, to clean up the bisection state and return to
Junio C Hamano9c512872015-08-12 21:59:25834the original HEAD, issue the following command:</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:23835<div class="listingblock">
836<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:53837<pre><code>$ git bisect reset</code></pre>
Junio C Hamano1a4e8412005-12-27 08:17:23838</div></div>
Junio C Hamano103b5722011-01-31 05:03:45839<div class="paragraph"><p>By default, this will return your tree to the commit that was checked
Junio C Hamanoc14e6ad2014-10-31 20:25:53840out before <code>git bisect start</code>. (A new <code>git bisect start</code> will also do
Junio C Hamanoc21ab052009-10-31 04:03:55841that, as it cleans up the old bisection state.)</p></div>
Junio C Hamano103b5722011-01-31 05:03:45842<div class="paragraph"><p>With an optional argument, you can return to a different commit
Junio C Hamanoc21ab052009-10-31 04:03:55843instead:</p></div>
844<div class="listingblock">
845<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:53846<pre><code>$ git bisect reset &lt;commit&gt;</code></pre>
Junio C Hamanoc21ab052009-10-31 04:03:55847</div></div>
Junio C Hamano9c512872015-08-12 21:59:25848<div class="paragraph"><p>For example, <code>git bisect reset bisect/bad</code> will check out the first
849bad revision, while <code>git bisect reset HEAD</code> will leave you on the
850current bisection commit and avoid switching commits at all.</p></div>
Junio C Hamano9d971152012-12-19 00:43:11851</div>
852<div class="sect2">
Junio C Hamano1eb56092015-10-05 20:39:53853<h3 id="_alternate_terms">Alternate terms</h3>
854<div class="paragraph"><p>Sometimes you are not looking for the commit that introduced a
855breakage, but rather for a commit that caused a change between some
856other "old" state and "new" state. For example, you might be looking
857for the commit that introduced a particular fix. Or you might be
858looking for the first commit in which the source-code filenames were
859finally all converted to your company&#8217;s naming standard. Or whatever.</p></div>
860<div class="paragraph"><p>In such cases it can be very confusing to use the terms "good" and
861"bad" to refer to "the state before the change" and "the state after
862the change". So instead, you can use the terms "old" and "new",
863respectively, in place of "good" and "bad". (But note that you cannot
864mix "good" and "bad" with "old" and "new" in a single session.)</p></div>
865<div class="paragraph"><p>In this more general usage, you provide <code>git bisect</code> with a "new"
Junio C Hamano761b4812017-04-17 07:27:59866commit that has some property and an "old" commit that doesn&#8217;t have that
Junio C Hamano1eb56092015-10-05 20:39:53867property. Each time <code>git bisect</code> checks out a commit, you test if that
868commit has the property. If it does, mark the commit as "new";
869otherwise, mark it as "old". When the bisection is done, <code>git bisect</code>
870will report which commit introduced the property.</p></div>
871<div class="paragraph"><p>To use "old" and "new" instead of "good" and bad, you must run <code>git
872bisect start</code> without commits as argument and then run the following
873commands to add the commits:</p></div>
874<div class="listingblock">
875<div class="content">
876<pre><code>git bisect old [&lt;rev&gt;]</code></pre>
877</div></div>
878<div class="paragraph"><p>to indicate that a commit was before the sought change, or</p></div>
879<div class="listingblock">
880<div class="content">
881<pre><code>git bisect new [&lt;rev&gt;...]</code></pre>
882</div></div>
883<div class="paragraph"><p>to indicate that it was after.</p></div>
884<div class="paragraph"><p>To get a reminder of the currently used terms, use</p></div>
885<div class="listingblock">
886<div class="content">
887<pre><code>git bisect terms</code></pre>
888</div></div>
889<div class="paragraph"><p>You can get just the old (respectively new) term with <code>git bisect term
890--term-old</code> or <code>git bisect term --term-good</code>.</p></div>
891<div class="paragraph"><p>If you would like to use your own terms instead of "bad"/"good" or
892"new"/"old", you can choose any names you like (except existing bisect
893subcommands like <code>reset</code>, <code>start</code>, &#8230;) by starting the
894bisection using</p></div>
895<div class="listingblock">
896<div class="content">
897<pre><code>git bisect start --term-old &lt;term-old&gt; --term-new &lt;term-new&gt;</code></pre>
898</div></div>
899<div class="paragraph"><p>For example, if you are looking for a commit that introduced a
900performance regression, you might use</p></div>
901<div class="listingblock">
902<div class="content">
903<pre><code>git bisect start --term-old fast --term-new slow</code></pre>
904</div></div>
905<div class="paragraph"><p>Or if you are looking for the commit that fixed a bug, you might use</p></div>
906<div class="listingblock">
907<div class="content">
908<pre><code>git bisect start --term-new fixed --term-old broken</code></pre>
909</div></div>
910<div class="paragraph"><p>Then, use <code>git bisect &lt;term-old&gt;</code> and <code>git bisect &lt;term-new&gt;</code> instead
911of <code>git bisect good</code> and <code>git bisect bad</code> to mark commits.</p></div>
912</div>
913<div class="sect2">
Junio C Hamanob72f6032017-11-15 05:57:08914<h3 id="_bisect_visualize_view">Bisect visualize/view</h3>
Junio C Hamano103b5722011-01-31 05:03:45915<div class="paragraph"><p>To see the currently remaining suspects in <em>gitk</em>, issue the following
Junio C Hamanob72f6032017-11-15 05:57:08916command during the bisection process (the subcommand <code>view</code> can be used
917as an alternative to <code>visualize</code>):</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:23918<div class="listingblock">
919<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:53920<pre><code>$ git bisect visualize</code></pre>
Junio C Hamano1a4e8412005-12-27 08:17:23921</div></div>
Junio C Hamano042f2142016-06-27 18:05:05922<div class="paragraph"><p>If the <code>DISPLAY</code> environment variable is not set, <em>git log</em> is used
Junio C Hamanoc14e6ad2014-10-31 20:25:53923instead. You can also give command-line options such as <code>-p</code> and
924<code>--stat</code>.</p></div>
Junio C Hamano942b35e2007-12-09 10:19:33925<div class="listingblock">
926<div class="content">
Junio C Hamanob72f6032017-11-15 05:57:08927<pre><code>$ git bisect visualize --stat</code></pre>
Junio C Hamano942b35e2007-12-09 10:19:33928</div></div>
Junio C Hamano9d971152012-12-19 00:43:11929</div>
930<div class="sect2">
931<h3 id="_bisect_log_and_bisect_replay">Bisect log and bisect replay</h3>
Junio C Hamano103b5722011-01-31 05:03:45932<div class="paragraph"><p>After having marked revisions as good or bad, issue the following
Junio C Hamanofd83b8e2009-03-22 08:21:41933command to show what has been done so far:</p></div>
Junio C Hamanob60308a2007-03-24 07:16:42934<div class="listingblock">
935<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:53936<pre><code>$ git bisect log</code></pre>
Junio C Hamanob60308a2007-03-24 07:16:42937</div></div>
Junio C Hamano103b5722011-01-31 05:03:45938<div class="paragraph"><p>If you discover that you made a mistake in specifying the status of a
Junio C Hamanofd83b8e2009-03-22 08:21:41939revision, you can save the output of this command to a file, edit it to
940remove the incorrect entries, and then issue the following commands to
941return to a corrected state:</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:23942<div class="listingblock">
943<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:53944<pre><code>$ git bisect reset
945$ git bisect replay that-file</code></pre>
Junio C Hamano1a4e8412005-12-27 08:17:23946</div></div>
Junio C Hamano9d971152012-12-19 00:43:11947</div>
948<div class="sect2">
949<h3 id="_avoiding_testing_a_commit">Avoiding testing a commit</h3>
Junio C Hamano9c512872015-08-12 21:59:25950<div class="paragraph"><p>If, in the middle of a bisect session, you know that the suggested
951revision is not a good one to test (e.g. it fails to build and you
952know that the failure does not have anything to do with the bug you
953are chasing), you can manually select a nearby commit and test that
954one instead.</p></div>
Junio C Hamano103b5722011-01-31 05:03:45955<div class="paragraph"><p>For example:</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:23956<div class="listingblock">
957<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:53958<pre><code>$ git bisect good/bad # previous round was good or bad.
Junio C Hamano9c512872015-08-12 21:59:25959Bisecting: 337 revisions left to test after this (roughly 9 steps)
Junio C Hamano1a4e8412005-12-27 08:17:23960$ git bisect visualize # oops, that is uninteresting.
Junio C Hamanofd83b8e2009-03-22 08:21:41961$ git reset --hard HEAD~3 # try 3 revisions before what
Junio C Hamanoc14e6ad2014-10-31 20:25:53962 # was suggested</code></pre>
Junio C Hamano1a4e8412005-12-27 08:17:23963</div></div>
Junio C Hamano103b5722011-01-31 05:03:45964<div class="paragraph"><p>Then compile and test the chosen revision, and afterwards mark
Junio C Hamano1de75722009-03-26 08:39:38965the revision as good or bad in the usual manner.</p></div>
Junio C Hamano9d971152012-12-19 00:43:11966</div>
967<div class="sect2">
968<h3 id="_bisect_skip">Bisect skip</h3>
Junio C Hamano9c512872015-08-12 21:59:25969<div class="paragraph"><p>Instead of choosing a nearby commit by yourself, you can ask Git to do
970it for you by issuing the command:</p></div>
Junio C Hamano1974bf22007-10-31 05:57:20971<div class="listingblock">
972<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:53973<pre><code>$ git bisect skip # Current version cannot be tested</code></pre>
Junio C Hamano1974bf22007-10-31 05:57:20974</div></div>
Junio C Hamano9c512872015-08-12 21:59:25975<div class="paragraph"><p>However, if you skip a commit adjacent to the one you are looking for,
976Git will be unable to tell exactly which of those commits was the
977first bad one.</p></div>
978<div class="paragraph"><p>You can also skip a range of commits, instead of just one commit,
979using range notation. For example:</p></div>
Junio C Hamanod796cea2008-12-03 03:51:10980<div class="listingblock">
981<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:53982<pre><code>$ git bisect skip v2.5..v2.6</code></pre>
Junio C Hamanod796cea2008-12-03 03:51:10983</div></div>
Junio C Hamanoc14e6ad2014-10-31 20:25:53984<div class="paragraph"><p>This tells the bisect process that no commit after <code>v2.5</code>, up to and
985including <code>v2.6</code>, should be tested.</p></div>
Junio C Hamano103b5722011-01-31 05:03:45986<div class="paragraph"><p>Note that if you also want to skip the first commit of the range you
Junio C Hamanofd83b8e2009-03-22 08:21:41987would issue the command:</p></div>
Junio C Hamanod796cea2008-12-03 03:51:10988<div class="listingblock">
989<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:53990<pre><code>$ git bisect skip v2.5 v2.5..v2.6</code></pre>
Junio C Hamanod796cea2008-12-03 03:51:10991</div></div>
Junio C Hamano9c512872015-08-12 21:59:25992<div class="paragraph"><p>This tells the bisect process that the commits between <code>v2.5</code> and
993<code>v2.6</code> (inclusive) should be skipped.</p></div>
Junio C Hamano9d971152012-12-19 00:43:11994</div>
995<div class="sect2">
996<h3 id="_cutting_down_bisection_by_giving_more_parameters_to_bisect_start">Cutting down bisection by giving more parameters to bisect start</h3>
Junio C Hamano103b5722011-01-31 05:03:45997<div class="paragraph"><p>You can further cut down the number of trials, if you know what part of
Junio C Hamanofd83b8e2009-03-22 08:21:41998the tree is involved in the problem you are tracking down, by specifying
Junio C Hamanoc14e6ad2014-10-31 20:25:53999path parameters when issuing the <code>bisect start</code> command:</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:231000<div class="listingblock">
1001<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:531002<pre><code>$ git bisect start -- arch/i386 include/asm-i386</code></pre>
Junio C Hamano12a3a232007-04-07 10:18:101003</div></div>
Junio C Hamano103b5722011-01-31 05:03:451004<div class="paragraph"><p>If you know beforehand more than one good commit, you can narrow the
Junio C Hamanofd83b8e2009-03-22 08:21:411005bisect space down by specifying all of the good commits immediately after
Junio C Hamanoc14e6ad2014-10-31 20:25:531006the bad commit when issuing the <code>bisect start</code> command:</p></div>
Junio C Hamano12a3a232007-04-07 10:18:101007<div class="listingblock">
1008<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:531009<pre><code>$ git bisect start v2.6.20-rc6 v2.6.20-rc4 v2.6.20-rc1 --
Junio C Hamano12a3a232007-04-07 10:18:101010 # v2.6.20-rc6 is bad
Junio C Hamanoc14e6ad2014-10-31 20:25:531011 # v2.6.20-rc4 and v2.6.20-rc1 are good</code></pre>
Junio C Hamano1a4e8412005-12-27 08:17:231012</div></div>
Junio C Hamano9d971152012-12-19 00:43:111013</div>
1014<div class="sect2">
1015<h3 id="_bisect_run">Bisect run</h3>
Junio C Hamano103b5722011-01-31 05:03:451016<div class="paragraph"><p>If you have a script that can tell if the current source code is good
Junio C Hamanofd83b8e2009-03-22 08:21:411017or bad, you can bisect by issuing the command:</p></div>
Junio C Hamanof440a232007-03-23 10:46:171018<div class="listingblock">
1019<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:531020<pre><code>$ git bisect run my_script arguments</code></pre>
Junio C Hamanof440a232007-03-23 10:46:171021</div></div>
Junio C Hamano9c512872015-08-12 21:59:251022<div class="paragraph"><p>Note that the script (<code>my_script</code> in the above example) should exit
1023with code 0 if the current source code is good/old, and exit with a
1024code between 1 and 127 (inclusive), except 125, if the current source
1025code is bad/new.</p></div>
Junio C Hamano103b5722011-01-31 05:03:451026<div class="paragraph"><p>Any other exit code will abort the bisect process. It should be noted
Junio C Hamano9c512872015-08-12 21:59:251027that a program that terminates via <code>exit(-1)</code> leaves $? = 255, (see the
1028exit(3) manual page), as the value is chopped with <code>&amp; 0377</code>.</p></div>
Junio C Hamano103b5722011-01-31 05:03:451029<div class="paragraph"><p>The special exit code 125 should be used when the current source code
Junio C Hamanofd83b8e2009-03-22 08:21:411030cannot be tested. If the script exits with this code, the current
Junio C Hamanoc14e6ad2014-10-31 20:25:531031revision will be skipped (see <code>git bisect skip</code> above). 125 was chosen
Junio C Hamanod2c978f2011-03-20 19:42:221032as the highest sensible value to use for this purpose, because 126 and 127
1033are used by POSIX shells to signal specific error status (127 is for
Junio C Hamanoee615802015-10-29 21:45:261034command not found, 126 is for command found but not executable&#8212;these
Junio C Hamanod2c978f2011-03-20 19:42:221035details do not matter, as they are normal errors in the script, as far as
Junio C Hamano9c512872015-08-12 21:59:251036<code>bisect run</code> is concerned).</p></div>
Junio C Hamano103b5722011-01-31 05:03:451037<div class="paragraph"><p>You may often find that during a bisect session you want to have
Junio C Hamanofd83b8e2009-03-22 08:21:411038temporary modifications (e.g. s/#define DEBUG 0/#define DEBUG 1/ in a
1039header file, or "revision that does not have this commit needs this
1040patch applied to work around another problem this bisection is not
1041interested in") applied to the revision being tested.</p></div>
Junio C Hamano103b5722011-01-31 05:03:451042<div class="paragraph"><p>To cope with such a situation, after the inner <em>git bisect</em> finds the
Junio C Hamanofd83b8e2009-03-22 08:21:411043next revision to test, the script can apply the patch
1044before compiling, run the real test, and afterwards decide if the
1045revision (possibly with the needed patch) passed the test and then
1046rewind the tree to the pristine state. Finally the script should exit
Junio C Hamano9c512872015-08-12 21:59:251047with the status of the real test to let the <code>git bisect run</code> command loop
Junio C Hamanofd83b8e2009-03-22 08:21:411048determine the eventual outcome of the bisect session.</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:231049</div>
Junio C Hamano9d971152012-12-19 00:43:111050</div>
1051</div>
1052<div class="sect1">
Junio C Hamanof7279012011-08-18 06:13:131053<h2 id="_options">OPTIONS</h2>
1054<div class="sectionbody">
1055<div class="dlist"><dl>
1056<dt class="hdlist1">
1057--no-checkout
1058</dt>
1059<dd>
1060<div class="paragraph"><p>Do not checkout the new working tree at each iteration of the bisection
Junio C Hamano92d80372016-07-13 22:00:051061process. Instead just update a special reference named <code>BISECT_HEAD</code> to make
Junio C Hamanof7279012011-08-18 06:13:131062it point to the commit that should be tested.</p></div>
1063<div class="paragraph"><p>This option may be useful when the test you would perform in each step
1064does not require a checked out tree.</p></div>
Junio C Hamanoc14e6ad2014-10-31 20:25:531065<div class="paragraph"><p>If the repository is bare, <code>--no-checkout</code> is assumed.</p></div>
Junio C Hamanof7279012011-08-18 06:13:131066</dd>
1067</dl></div>
1068</div>
Junio C Hamano9d971152012-12-19 00:43:111069</div>
1070<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:311071<h2 id="_examples">EXAMPLES</h2>
Junio C Hamano6d76d612008-05-09 05:46:081072<div class="sectionbody">
Junio C Hamano103b5722011-01-31 05:03:451073<div class="ulist"><ul>
Junio C Hamano6d76d612008-05-09 05:46:081074<li>
1075<p>
1076Automatically bisect a broken build between v1.2 and HEAD:
1077</p>
1078<div class="listingblock">
1079<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:531080<pre><code>$ git bisect start HEAD v1.2 -- # HEAD is bad, v1.2 is good
Junio C Hamano97cc08f2013-02-14 21:11:151081$ git bisect run make # "make" builds the app
Junio C Hamanoc14e6ad2014-10-31 20:25:531082$ git bisect reset # quit the bisect session</code></pre>
Junio C Hamano6d76d612008-05-09 05:46:081083</div></div>
1084</li>
1085<li>
1086<p>
Junio C Hamano0a235222009-03-06 08:21:091087Automatically bisect a test failure between origin and HEAD:
1088</p>
1089<div class="listingblock">
1090<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:531091<pre><code>$ git bisect start HEAD origin -- # HEAD is bad, origin is good
Junio C Hamano97cc08f2013-02-14 21:11:151092$ git bisect run make test # "make test" builds and tests
Junio C Hamanoc14e6ad2014-10-31 20:25:531093$ git bisect reset # quit the bisect session</code></pre>
Junio C Hamano0a235222009-03-06 08:21:091094</div></div>
1095</li>
1096<li>
1097<p>
Junio C Hamano6d76d612008-05-09 05:46:081098Automatically bisect a broken test case:
1099</p>
1100<div class="listingblock">
1101<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:531102<pre><code>$ cat ~/test.sh
Junio C Hamano6d76d612008-05-09 05:46:081103#!/bin/sh
Junio C Hamanofd83b8e2009-03-22 08:21:411104make || exit 125 # this skips broken builds
Junio C Hamano9a2fb2d2011-03-23 05:40:151105~/check_test_case.sh # does the test case pass?
Junio C Hamano6d76d612008-05-09 05:46:081106$ git bisect start HEAD HEAD~10 -- # culprit is among the last 10
Junio C Hamano97cc08f2013-02-14 21:11:151107$ git bisect run ~/test.sh
Junio C Hamanoc14e6ad2014-10-31 20:25:531108$ git bisect reset # quit the bisect session</code></pre>
Junio C Hamano6d76d612008-05-09 05:46:081109</div></div>
Junio C Hamano9c512872015-08-12 21:59:251110<div class="paragraph"><p>Here we use a <code>test.sh</code> custom script. In this script, if <code>make</code>
Junio C Hamano9a2fb2d2011-03-23 05:40:151111fails, we skip the current commit.
Junio C Hamano9c512872015-08-12 21:59:251112<code>check_test_case.sh</code> should <code>exit 0</code> if the test case passes,
1113and <code>exit 1</code> otherwise.</p></div>
1114<div class="paragraph"><p>It is safer if both <code>test.sh</code> and <code>check_test_case.sh</code> are
Junio C Hamanofd83b8e2009-03-22 08:21:411115outside the repository to prevent interactions between the bisect,
1116make and test processes and the scripts.</p></div>
Junio C Hamano6d76d612008-05-09 05:46:081117</li>
Junio C Hamano0a235222009-03-06 08:21:091118<li>
1119<p>
Junio C Hamano9a2fb2d2011-03-23 05:40:151120Automatically bisect with temporary modifications (hot-fix):
1121</p>
1122<div class="listingblock">
1123<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:531124<pre><code>$ cat ~/test.sh
Junio C Hamano9a2fb2d2011-03-23 05:40:151125#!/bin/sh
1126
1127# tweak the working tree by merging the hot-fix branch
1128# and then attempt a build
1129if git merge --no-commit hot-fix &amp;&amp;
1130 make
1131then
1132 # run project specific test and report its status
1133 ~/check_test_case.sh
1134 status=$?
1135else
1136 # tell the caller this is untestable
1137 status=125
1138fi
1139
1140# undo the tweak to allow clean flipping to the next commit
1141git reset --hard
1142
1143# return control
Junio C Hamanoc14e6ad2014-10-31 20:25:531144exit $status</code></pre>
Junio C Hamano9a2fb2d2011-03-23 05:40:151145</div></div>
1146<div class="paragraph"><p>This applies modifications from a hot-fix branch before each test run,
1147e.g. in case your build or test environment changed so that older
1148revisions may need a fix which newer ones have already. (Make sure the
1149hot-fix branch is based off a commit which is contained in all revisions
1150which you are bisecting, so that the merge does not pull in too much, or
Junio C Hamanoc14e6ad2014-10-31 20:25:531151use <code>git cherry-pick</code> instead of <code>git merge</code>.)</p></div>
Junio C Hamano9a2fb2d2011-03-23 05:40:151152</li>
1153<li>
1154<p>
1155Automatically bisect a broken test case:
Junio C Hamano0a235222009-03-06 08:21:091156</p>
1157<div class="listingblock">
1158<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:531159<pre><code>$ git bisect start HEAD HEAD~10 -- # culprit is among the last 10
Junio C Hamano97cc08f2013-02-14 21:11:151160$ git bisect run sh -c "make || exit 125; ~/check_test_case.sh"
Junio C Hamanoc14e6ad2014-10-31 20:25:531161$ git bisect reset # quit the bisect session</code></pre>
Junio C Hamano0a235222009-03-06 08:21:091162</div></div>
Junio C Hamano9a2fb2d2011-03-23 05:40:151163<div class="paragraph"><p>This shows that you can do without a run script if you write the test
1164on a single line.</p></div>
Junio C Hamano0a235222009-03-06 08:21:091165</li>
Junio C Hamanof7279012011-08-18 06:13:131166<li>
1167<p>
1168Locate a good region of the object graph in a damaged repository
1169</p>
1170<div class="listingblock">
1171<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:531172<pre><code>$ git bisect start HEAD &lt;known-good-commit&gt; [ &lt;boundary-commit&gt; ... ] --no-checkout
Junio C Hamanof7279012011-08-18 06:13:131173$ git bisect run sh -c '
1174 GOOD=$(git for-each-ref "--format=%(objectname)" refs/bisect/good-*) &amp;&amp;
1175 git rev-list --objects BISECT_HEAD --not $GOOD &gt;tmp.$$ &amp;&amp;
1176 git pack-objects --stdout &gt;/dev/null &lt;tmp.$$
1177 rc=$?
1178 rm -f tmp.$$
Junio C Hamano97cc08f2013-02-14 21:11:151179 test $rc = 0'
1180
Junio C Hamanoc14e6ad2014-10-31 20:25:531181$ git bisect reset # quit the bisect session</code></pre>
Junio C Hamanof7279012011-08-18 06:13:131182</div></div>
1183<div class="paragraph"><p>In this case, when <em>git bisect run</em> finishes, bisect/bad will refer to a commit that
1184has at least one parent whose reachable graph is fully traversable in the sense
1185required by <em>git pack objects</em>.</p></div>
1186</li>
Junio C Hamano1eb56092015-10-05 20:39:531187<li>
1188<p>
1189Look for a fix instead of a regression in the code
1190</p>
1191<div class="listingblock">
1192<div class="content">
1193<pre><code>$ git bisect start
1194$ git bisect new HEAD # current commit is marked as new
1195$ git bisect old HEAD~10 # the tenth commit from now is marked as old</code></pre>
1196</div></div>
1197<div class="paragraph"><p>or:</p></div>
1198</li>
Junio C Hamanoba4b9282008-07-06 05:20:311199</ul></div>
Junio C Hamano1eb56092015-10-05 20:39:531200<div class="listingblock">
1201<div class="content">
1202<pre><code>$ git bisect start --term-old broken --term-new fixed
1203$ git bisect fixed
1204$ git bisect broken HEAD~10</code></pre>
1205</div></div>
Junio C Hamano9c512872015-08-12 21:59:251206<div class="sect2">
1207<h3 id="_getting_help">Getting help</h3>
1208<div class="paragraph"><p>Use <code>git bisect</code> to get a short usage description, and <code>git bisect
1209help</code> or <code>git bisect -h</code> to get a long usage description.</p></div>
1210</div>
Junio C Hamano6d76d612008-05-09 05:46:081211</div>
Junio C Hamano9d971152012-12-19 00:43:111212</div>
1213<div class="sect1">
Junio C Hamano2bd8a742009-12-01 21:16:591214<h2 id="_see_also">SEE ALSO</h2>
1215<div class="sectionbody">
Junio C Hamano103b5722011-01-31 05:03:451216<div class="paragraph"><p><a href="git-bisect-lk2009.html">Fighting regressions with git bisect</a>,
Junio C Hamanoa28a9202012-06-21 07:08:231217<a href="git-blame.html">git-blame(1)</a>.</p></div>
Junio C Hamano2bd8a742009-12-01 21:16:591218</div>
Junio C Hamano9d971152012-12-19 00:43:111219</div>
1220<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:311221<h2 id="_git">GIT</h2>
Junio C Hamano1a4e8412005-12-27 08:17:231222<div class="sectionbody">
Junio C Hamanoa28a9202012-06-21 07:08:231223<div class="paragraph"><p>Part of the <a href="git.html">git(1)</a> suite</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:231224</div>
Junio C Hamano7bd050f2011-09-22 06:32:221225</div>
Junio C Hamano9d971152012-12-19 00:43:111226</div>
Junio C Hamano7bd050f2011-09-22 06:32:221227<div id="footnotes"><hr /></div>
Junio C Hamano1a4e8412005-12-27 08:17:231228<div id="footer">
1229<div id="footer-text">
Junio C Hamano2ef0ba32018-01-26 23:13:531230Last updated
1231 2018-01-26 15:11:04 PST
Junio C Hamano1a4e8412005-12-27 08:17:231232</div>
1233</div>
1234</body>
1235</html>