blob: b7b131bad9b7db29f029a3cf5274c2e253c2c1fe [file] [log] [blame]
Junio C Hamano2bd8a742009-12-01 21:16:591<!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" />
6<meta name="generator" content="AsciiDoc 8.6.8" />
Junio C Hamano103b5722011-01-31 05:03:457<title>Fighting regressions with git bisect</title>
Junio C Hamano2bd8a742009-12-01 21:16:598<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 Hamano2bd8a742009-12-01 21:16:5924}
25
26body {
27 margin: 1em 5% 1em 5%;
28}
29
30a {
31 color: blue;
32 text-decoration: underline;
33}
34a:visited {
35 color: fuchsia;
36}
37
38em {
39 font-style: italic;
Junio C Hamano103b5722011-01-31 05:03:4540 color: navy;
Junio C Hamano2bd8a742009-12-01 21:16:5941}
42
43strong {
44 font-weight: bold;
Junio C Hamano103b5722011-01-31 05:03:4545 color: #083194;
Junio C Hamano2bd8a742009-12-01 21:16:5946}
47
Junio C Hamano2bd8a742009-12-01 21:16:5948h1, h2, h3, h4, h5, h6 {
49 color: #527bbd;
Junio C Hamano2bd8a742009-12-01 21:16:5950 margin-top: 1.2em;
51 margin-bottom: 0.5em;
52 line-height: 1.3;
53}
54
55h1, h2, h3 {
56 border-bottom: 2px solid silver;
57}
58h2 {
59 padding-top: 0.5em;
60}
61h3 {
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 Hamano2bd8a742009-12-01 21:16:5970
71div.sectionbody {
Junio C Hamano2bd8a742009-12-01 21:16:5972 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 Hamano9d971152012-12-19 00:43:1190.monospaced, code, pre {
91 font-family: "Courier New", Courier, monospace;
92 font-size: inherit;
93 color: navy;
Junio C Hamano2bd8a742009-12-01 21:16:5994 padding: 0;
95 margin: 0;
96}
97
Junio C Hamano9d971152012-12-19 00:43:1198
99#author {
Junio C Hamano2bd8a742009-12-01 21:16:59100 color: #527bbd;
Junio C Hamano2bd8a742009-12-01 21:16:59101 font-weight: bold;
102 font-size: 1.1em;
103}
Junio C Hamano9d971152012-12-19 00:43:11104#email {
Junio C Hamano2bd8a742009-12-01 21:16:59105}
Junio C Hamano9d971152012-12-19 00:43:11106#revnumber, #revdate, #revremark {
Junio C Hamano2bd8a742009-12-01 21:16:59107}
108
Junio C Hamano9d971152012-12-19 00:43:11109#footer {
Junio C Hamano2bd8a742009-12-01 21:16:59110 font-size: small;
111 border-top: 2px solid silver;
112 padding-top: 0.5em;
113 margin-top: 4.0em;
114}
Junio C Hamano9d971152012-12-19 00:43:11115#footer-text {
Junio C Hamano2bd8a742009-12-01 21:16:59116 float: left;
117 padding-bottom: 0.5em;
118}
Junio C Hamano9d971152012-12-19 00:43:11119#footer-badges {
Junio C Hamano2bd8a742009-12-01 21:16:59120 float: right;
121 padding-bottom: 0.5em;
122}
123
Junio C Hamano9d971152012-12-19 00:43:11124#preamble {
Junio C Hamano103b5722011-01-31 05:03:45125 margin-top: 1.5em;
126 margin-bottom: 1.5em;
127}
Junio C Hamano9d971152012-12-19 00:43:11128div.imageblock, div.exampleblock, div.verseblock,
Junio C Hamano2bd8a742009-12-01 21:16:59129div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock,
130div.admonitionblock {
Junio C Hamano7bd050f2011-09-22 06:32:22131 margin-top: 1.0em;
Junio C Hamano2bd8a742009-12-01 21:16:59132 margin-bottom: 1.5em;
133}
134div.admonitionblock {
Junio C Hamano7bd050f2011-09-22 06:32:22135 margin-top: 2.0em;
136 margin-bottom: 2.0em;
137 margin-right: 10%;
138 color: #606060;
Junio C Hamano2bd8a742009-12-01 21:16:59139}
140
141div.content { /* Block element content. */
142 padding: 0;
143}
144
145/* Block element titles. */
146div.title, caption.title {
Junio C Hamano103b5722011-01-31 05:03:45147 color: #527bbd;
Junio C Hamano2bd8a742009-12-01 21:16:59148 font-weight: bold;
149 text-align: left;
150 margin-top: 1.0em;
151 margin-bottom: 0.5em;
152}
153div.title + * {
154 margin-top: 0;
155}
156
157td div.title:first-child {
158 margin-top: 0.0em;
159}
160div.content div.title:first-child {
161 margin-top: 0.0em;
162}
163div.content + div.title {
164 margin-top: 0.0em;
165}
166
167div.sidebarblock > div.content {
168 background: #ffffee;
Junio C Hamano9d971152012-12-19 00:43:11169 border: 1px solid #dddddd;
170 border-left: 4px solid #f0f0f0;
Junio C Hamano2bd8a742009-12-01 21:16:59171 padding: 0.5em;
172}
173
Junio C Hamano2bd8a742009-12-01 21:16:59174div.listingblock > div.content {
Junio C Hamano9d971152012-12-19 00:43:11175 border: 1px solid #dddddd;
176 border-left: 5px solid #f0f0f0;
177 background: #f8f8f8;
Junio C Hamano2bd8a742009-12-01 21:16:59178 padding: 0.5em;
179}
180
Junio C Hamano7bd050f2011-09-22 06:32:22181div.quoteblock, div.verseblock {
182 padding-left: 1.0em;
183 margin-left: 1.0em;
Junio C Hamano103b5722011-01-31 05:03:45184 margin-right: 10%;
Junio C Hamano9d971152012-12-19 00:43:11185 border-left: 5px solid #f0f0f0;
186 color: #888;
Junio C Hamano2bd8a742009-12-01 21:16:59187}
Junio C Hamano7bd050f2011-09-22 06:32:22188
Junio C Hamano103b5722011-01-31 05:03:45189div.quoteblock > div.attribution {
190 padding-top: 0.5em;
Junio C Hamano2bd8a742009-12-01 21:16:59191 text-align: right;
192}
Junio C Hamano103b5722011-01-31 05:03:45193
Junio C Hamano9d971152012-12-19 00:43:11194div.verseblock > pre.content {
195 font-family: inherit;
196 font-size: inherit;
Junio C Hamano103b5722011-01-31 05:03:45197}
198div.verseblock > div.attribution {
199 padding-top: 0.75em;
200 text-align: left;
201}
202/* DEPRECATED: Pre version 8.2.7 verse style literal block. */
Junio C Hamano2bd8a742009-12-01 21:16:59203div.verseblock + div.attribution {
204 text-align: left;
205}
206
207div.admonitionblock .icon {
208 vertical-align: top;
209 font-size: 1.1em;
210 font-weight: bold;
211 text-decoration: underline;
212 color: #527bbd;
213 padding-right: 0.5em;
214}
215div.admonitionblock td.content {
216 padding-left: 0.5em;
Junio C Hamano7bd050f2011-09-22 06:32:22217 border-left: 3px solid #dddddd;
Junio C Hamano2bd8a742009-12-01 21:16:59218}
219
220div.exampleblock > div.content {
Junio C Hamano7bd050f2011-09-22 06:32:22221 border-left: 3px solid #dddddd;
222 padding-left: 0.5em;
Junio C Hamano2bd8a742009-12-01 21:16:59223}
224
Junio C Hamano2bd8a742009-12-01 21:16:59225div.imageblock div.content { padding-left: 0; }
Junio C Hamano2bd8a742009-12-01 21:16:59226span.image img { border-style: none; }
Junio C Hamano103b5722011-01-31 05:03:45227a.image:visited { color: white; }
Junio C Hamano2bd8a742009-12-01 21:16:59228
229dl {
230 margin-top: 0.8em;
231 margin-bottom: 0.8em;
232}
233dt {
234 margin-top: 0.5em;
235 margin-bottom: 0;
Junio C Hamano103b5722011-01-31 05:03:45236 font-style: normal;
237 color: navy;
Junio C Hamano2bd8a742009-12-01 21:16:59238}
239dd > *:first-child {
Junio C Hamano103b5722011-01-31 05:03:45240 margin-top: 0.1em;
Junio C Hamano2bd8a742009-12-01 21:16:59241}
242
243ul, ol {
244 list-style-position: outside;
245}
Junio C Hamano103b5722011-01-31 05:03:45246ol.arabic {
247 list-style-type: decimal;
248}
249ol.loweralpha {
Junio C Hamano2bd8a742009-12-01 21:16:59250 list-style-type: lower-alpha;
251}
Junio C Hamano103b5722011-01-31 05:03:45252ol.upperalpha {
253 list-style-type: upper-alpha;
254}
255ol.lowerroman {
256 list-style-type: lower-roman;
257}
258ol.upperroman {
259 list-style-type: upper-roman;
260}
261
262div.compact ul, div.compact ol,
263div.compact p, div.compact p,
264div.compact div, div.compact div {
265 margin-top: 0.1em;
266 margin-bottom: 0.1em;
267}
Junio C Hamano2bd8a742009-12-01 21:16:59268
Junio C Hamano2bd8a742009-12-01 21:16:59269tfoot {
270 font-weight: bold;
271}
Junio C Hamano103b5722011-01-31 05:03:45272td > div.verse {
273 white-space: pre;
274}
Junio C Hamano103b5722011-01-31 05:03:45275
276div.hdlist {
Junio C Hamano2bd8a742009-12-01 21:16:59277 margin-top: 0.8em;
278 margin-bottom: 0.8em;
279}
Junio C Hamano103b5722011-01-31 05:03:45280div.hdlist tr {
281 padding-bottom: 15px;
Junio C Hamano2bd8a742009-12-01 21:16:59282}
Junio C Hamano103b5722011-01-31 05:03:45283dt.hdlist1.strong, td.hdlist1.strong {
284 font-weight: bold;
285}
286td.hdlist1 {
Junio C Hamano2bd8a742009-12-01 21:16:59287 vertical-align: top;
Junio C Hamano103b5722011-01-31 05:03:45288 font-style: normal;
Junio C Hamano2bd8a742009-12-01 21:16:59289 padding-right: 0.8em;
Junio C Hamano103b5722011-01-31 05:03:45290 color: navy;
Junio C Hamano2bd8a742009-12-01 21:16:59291}
Junio C Hamano103b5722011-01-31 05:03:45292td.hdlist2 {
Junio C Hamano2bd8a742009-12-01 21:16:59293 vertical-align: top;
294}
Junio C Hamano103b5722011-01-31 05:03:45295div.hdlist.compact tr {
296 margin: 0;
297 padding-bottom: 0;
298}
299
300.comment {
301 background: yellow;
302}
Junio C Hamano2bd8a742009-12-01 21:16:59303
Junio C Hamano7bd050f2011-09-22 06:32:22304.footnote, .footnoteref {
305 font-size: 0.8em;
306}
307
308span.footnote, span.footnoteref {
309 vertical-align: super;
310}
311
312#footnotes {
313 margin: 20px 0 20px 0;
314 padding: 7px 0 0 0;
315}
316
317#footnotes div.footnote {
318 margin: 0 0 5px 0;
319}
320
321#footnotes hr {
322 border: none;
323 border-top: 1px solid silver;
324 height: 1px;
325 text-align: left;
326 margin-left: 0;
327 width: 20%;
328 min-width: 100px;
329}
330
Junio C Hamano9d971152012-12-19 00:43:11331div.colist td {
332 padding-right: 0.5em;
333 padding-bottom: 0.3em;
334 vertical-align: top;
335}
336div.colist td img {
337 margin-top: 0.3em;
Junio C Hamano2bd8a742009-12-01 21:16:59338}
339
Junio C Hamano9d971152012-12-19 00:43:11340@media print {
341 #footer-badges { display: none; }
342}
343
344#toc {
Junio C Hamano7bd050f2011-09-22 06:32:22345 margin-bottom: 2.5em;
346}
347
Junio C Hamano9d971152012-12-19 00:43:11348#toctitle {
Junio C Hamano2bd8a742009-12-01 21:16:59349 color: #527bbd;
Junio C Hamano2bd8a742009-12-01 21:16:59350 font-size: 1.1em;
351 font-weight: bold;
352 margin-top: 1.0em;
353 margin-bottom: 0.1em;
354}
355
Junio C Hamano9d971152012-12-19 00:43:11356div.toclevel0, div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 {
Junio C Hamano2bd8a742009-12-01 21:16:59357 margin-top: 0;
358 margin-bottom: 0;
359}
360div.toclevel2 {
361 margin-left: 2em;
362 font-size: 0.9em;
363}
364div.toclevel3 {
365 margin-left: 4em;
366 font-size: 0.9em;
367}
368div.toclevel4 {
369 margin-left: 6em;
370 font-size: 0.9em;
371}
Junio C Hamano2bd8a742009-12-01 21:16:59372
Junio C Hamano9d971152012-12-19 00:43:11373span.aqua { color: aqua; }
374span.black { color: black; }
375span.blue { color: blue; }
376span.fuchsia { color: fuchsia; }
377span.gray { color: gray; }
378span.green { color: green; }
379span.lime { color: lime; }
380span.maroon { color: maroon; }
381span.navy { color: navy; }
382span.olive { color: olive; }
383span.purple { color: purple; }
384span.red { color: red; }
385span.silver { color: silver; }
386span.teal { color: teal; }
387span.white { color: white; }
388span.yellow { color: yellow; }
389
390span.aqua-background { background: aqua; }
391span.black-background { background: black; }
392span.blue-background { background: blue; }
393span.fuchsia-background { background: fuchsia; }
394span.gray-background { background: gray; }
395span.green-background { background: green; }
396span.lime-background { background: lime; }
397span.maroon-background { background: maroon; }
398span.navy-background { background: navy; }
399span.olive-background { background: olive; }
400span.purple-background { background: purple; }
401span.red-background { background: red; }
402span.silver-background { background: silver; }
403span.teal-background { background: teal; }
404span.white-background { background: white; }
405span.yellow-background { background: yellow; }
406
407span.big { font-size: 2em; }
408span.small { font-size: 0.6em; }
409
410span.underline { text-decoration: underline; }
411span.overline { text-decoration: overline; }
412span.line-through { text-decoration: line-through; }
413
414div.unbreakable { page-break-inside: avoid; }
415
416
417/*
418 * xhtml11 specific
419 *
420 * */
421
422div.tableblock {
423 margin-top: 1.0em;
424 margin-bottom: 1.5em;
Junio C Hamano2bd8a742009-12-01 21:16:59425}
Junio C Hamano9d971152012-12-19 00:43:11426div.tableblock > table {
427 border: 3px solid #527bbd;
428}
429thead, p.table.header {
Junio C Hamano2bd8a742009-12-01 21:16:59430 font-weight: bold;
Junio C Hamano9d971152012-12-19 00:43:11431 color: #527bbd;
432}
433p.table {
434 margin-top: 0;
435}
436/* Because the table frame attribute is overriden by CSS in most browsers. */
437div.tableblock > table[frame="void"] {
438 border-style: none;
439}
440div.tableblock > table[frame="hsides"] {
441 border-left-style: none;
442 border-right-style: none;
443}
444div.tableblock > table[frame="vsides"] {
445 border-top-style: none;
446 border-bottom-style: none;
Junio C Hamano2bd8a742009-12-01 21:16:59447}
448
Junio C Hamano9d971152012-12-19 00:43:11449
450/*
451 * html5 specific
452 *
453 * */
454
455table.tableblock {
456 margin-top: 1.0em;
457 margin-bottom: 1.5em;
458}
459thead, p.tableblock.header {
460 font-weight: bold;
461 color: #527bbd;
462}
463p.tableblock {
464 margin-top: 0;
465}
466table.tableblock {
467 border-width: 3px;
468 border-spacing: 0px;
469 border-style: solid;
470 border-color: #527bbd;
471 border-collapse: collapse;
472}
473th.tableblock, td.tableblock {
474 border-width: 1px;
475 padding: 4px;
476 border-style: solid;
477 border-color: #527bbd;
Junio C Hamano2bd8a742009-12-01 21:16:59478}
479
Junio C Hamano9d971152012-12-19 00:43:11480table.tableblock.frame-topbot {
481 border-left-style: hidden;
482 border-right-style: hidden;
483}
484table.tableblock.frame-sides {
485 border-top-style: hidden;
486 border-bottom-style: hidden;
487}
488table.tableblock.frame-none {
489 border-style: hidden;
490}
491
492th.tableblock.halign-left, td.tableblock.halign-left {
493 text-align: left;
494}
495th.tableblock.halign-center, td.tableblock.halign-center {
496 text-align: center;
497}
498th.tableblock.halign-right, td.tableblock.halign-right {
Junio C Hamano103b5722011-01-31 05:03:45499 text-align: right;
500}
501
Junio C Hamano9d971152012-12-19 00:43:11502th.tableblock.valign-top, td.tableblock.valign-top {
503 vertical-align: top;
Junio C Hamano103b5722011-01-31 05:03:45504}
Junio C Hamano9d971152012-12-19 00:43:11505th.tableblock.valign-middle, td.tableblock.valign-middle {
506 vertical-align: middle;
507}
508th.tableblock.valign-bottom, td.tableblock.valign-bottom {
509 vertical-align: bottom;
Junio C Hamano2bd8a742009-12-01 21:16:59510}
511
Junio C Hamano9d971152012-12-19 00:43:11512
513/*
514 * manpage specific
515 *
516 * */
517
518body.manpage h1 {
519 padding-top: 0.5em;
520 padding-bottom: 0.5em;
521 border-top: 2px solid silver;
522 border-bottom: 2px solid silver;
523}
524body.manpage h2 {
525 border-style: none;
526}
527body.manpage div.sectionbody {
528 margin-left: 3em;
Junio C Hamano2bd8a742009-12-01 21:16:59529}
530
Junio C Hamano9d971152012-12-19 00:43:11531@media print {
532 body.manpage div#toc { display: none; }
533}
534
535
Junio C Hamano2bd8a742009-12-01 21:16:59536</style>
Junio C Hamano7bd050f2011-09-22 06:32:22537<script type="text/javascript">
538/*<![CDATA[*/
Junio C Hamano7bd050f2011-09-22 06:32:22539var asciidoc = { // Namespace.
540
541/////////////////////////////////////////////////////////////////////
542// Table Of Contents generator
543/////////////////////////////////////////////////////////////////////
544
545/* Author: Mihai Bazon, September 2002
546 * http://students.infoiasi.ro/~mishoo
547 *
548 * Table Of Content generator
549 * Version: 0.4
550 *
551 * Feel free to use this script under the terms of the GNU General Public
552 * License, as long as you do not remove or alter this notice.
553 */
554
555 /* modified by Troy D. Hanson, September 2006. License: GPL */
556 /* modified by Stuart Rackham, 2006, 2009. License: GPL */
557
558// toclevels = 1..4.
559toc: function (toclevels) {
560
561 function getText(el) {
562 var text = "";
563 for (var i = el.firstChild; i != null; i = i.nextSibling) {
564 if (i.nodeType == 3 /* Node.TEXT_NODE */) // IE doesn't speak constants.
565 text += i.data;
566 else if (i.firstChild != null)
567 text += getText(i);
568 }
569 return text;
570 }
571
572 function TocEntry(el, text, toclevel) {
573 this.element = el;
574 this.text = text;
575 this.toclevel = toclevel;
576 }
577
578 function tocEntries(el, toclevels) {
579 var result = new Array;
Junio C Hamano9d971152012-12-19 00:43:11580 var re = new RegExp('[hH]([1-'+(toclevels+1)+'])');
Junio C Hamano7bd050f2011-09-22 06:32:22581 // Function that scans the DOM tree for header elements (the DOM2
582 // nodeIterator API would be a better technique but not supported by all
583 // browsers).
584 var iterate = function (el) {
585 for (var i = el.firstChild; i != null; i = i.nextSibling) {
586 if (i.nodeType == 1 /* Node.ELEMENT_NODE */) {
587 var mo = re.exec(i.tagName);
588 if (mo && (i.getAttribute("class") || i.getAttribute("className")) != "float") {
589 result[result.length] = new TocEntry(i, getText(i), mo[1]-1);
590 }
591 iterate(i);
592 }
593 }
594 }
595 iterate(el);
596 return result;
597 }
598
599 var toc = document.getElementById("toc");
Junio C Hamano9d971152012-12-19 00:43:11600 if (!toc) {
601 return;
602 }
603
604 // Delete existing TOC entries in case we're reloading the TOC.
605 var tocEntriesToRemove = [];
606 var i;
607 for (i = 0; i < toc.childNodes.length; i++) {
608 var entry = toc.childNodes[i];
609 if (entry.nodeName.toLowerCase() == 'div'
610 && entry.getAttribute("class")
611 && entry.getAttribute("class").match(/^toclevel/))
612 tocEntriesToRemove.push(entry);
613 }
614 for (i = 0; i < tocEntriesToRemove.length; i++) {
615 toc.removeChild(tocEntriesToRemove[i]);
616 }
617
618 // Rebuild TOC entries.
Junio C Hamano7bd050f2011-09-22 06:32:22619 var entries = tocEntries(document.getElementById("content"), toclevels);
620 for (var i = 0; i < entries.length; ++i) {
621 var entry = entries[i];
622 if (entry.element.id == "")
623 entry.element.id = "_toc_" + i;
624 var a = document.createElement("a");
625 a.href = "#" + entry.element.id;
626 a.appendChild(document.createTextNode(entry.text));
627 var div = document.createElement("div");
628 div.appendChild(a);
629 div.className = "toclevel" + entry.toclevel;
630 toc.appendChild(div);
631 }
632 if (entries.length == 0)
633 toc.parentNode.removeChild(toc);
634},
635
636
637/////////////////////////////////////////////////////////////////////
638// Footnotes generator
639/////////////////////////////////////////////////////////////////////
640
641/* Based on footnote generation code from:
642 * http://www.brandspankingnew.net/archive/2005/07/format_footnote.html
643 */
644
645footnotes: function () {
Junio C Hamano9d971152012-12-19 00:43:11646 // Delete existing footnote entries in case we're reloading the footnodes.
647 var i;
Junio C Hamano7bd050f2011-09-22 06:32:22648 var noteholder = document.getElementById("footnotes");
Junio C Hamano9d971152012-12-19 00:43:11649 if (!noteholder) {
650 return;
651 }
652 var entriesToRemove = [];
653 for (i = 0; i < noteholder.childNodes.length; i++) {
654 var entry = noteholder.childNodes[i];
655 if (entry.nodeName.toLowerCase() == 'div' && entry.getAttribute("class") == "footnote")
656 entriesToRemove.push(entry);
657 }
658 for (i = 0; i < entriesToRemove.length; i++) {
659 noteholder.removeChild(entriesToRemove[i]);
660 }
661
662 // Rebuild footnote entries.
663 var cont = document.getElementById("content");
Junio C Hamano7bd050f2011-09-22 06:32:22664 var spans = cont.getElementsByTagName("span");
665 var refs = {};
666 var n = 0;
667 for (i=0; i<spans.length; i++) {
668 if (spans[i].className == "footnote") {
669 n++;
Junio C Hamano9d971152012-12-19 00:43:11670 var note = spans[i].getAttribute("data-note");
671 if (!note) {
672 // Use [\s\S] in place of . so multi-line matches work.
673 // Because JavaScript has no s (dotall) regex flag.
674 note = spans[i].innerHTML.match(/\s*\[([\s\S]*)]\s*/)[1];
675 spans[i].innerHTML =
676 "[<a id='_footnoteref_" + n + "' href='#_footnote_" + n +
677 "' title='View footnote' class='footnote'>" + n + "</a>]";
678 spans[i].setAttribute("data-note", note);
679 }
Junio C Hamano7bd050f2011-09-22 06:32:22680 noteholder.innerHTML +=
681 "<div class='footnote' id='_footnote_" + n + "'>" +
682 "<a href='#_footnoteref_" + n + "' title='Return to text'>" +
683 n + "</a>. " + note + "</div>";
Junio C Hamano7bd050f2011-09-22 06:32:22684 var id =spans[i].getAttribute("id");
685 if (id != null) refs["#"+id] = n;
686 }
687 }
688 if (n == 0)
689 noteholder.parentNode.removeChild(noteholder);
690 else {
691 // Process footnoterefs.
692 for (i=0; i<spans.length; i++) {
693 if (spans[i].className == "footnoteref") {
694 var href = spans[i].getElementsByTagName("a")[0].getAttribute("href");
695 href = href.match(/#.*/)[0]; // Because IE return full URL.
696 n = refs[href];
697 spans[i].innerHTML =
698 "[<a href='#_footnote_" + n +
699 "' title='View footnote' class='footnote'>" + n + "</a>]";
700 }
701 }
702 }
Junio C Hamano9d971152012-12-19 00:43:11703},
704
705install: function(toclevels) {
706 var timerId;
707
708 function reinstall() {
709 asciidoc.footnotes();
710 if (toclevels) {
711 asciidoc.toc(toclevels);
712 }
713 }
714
715 function reinstallAndRemoveTimer() {
716 clearInterval(timerId);
717 reinstall();
718 }
719
720 timerId = setInterval(reinstall, 500);
721 if (document.addEventListener)
722 document.addEventListener("DOMContentLoaded", reinstallAndRemoveTimer, false);
723 else
724 window.onload = reinstallAndRemoveTimer;
Junio C Hamano7bd050f2011-09-22 06:32:22725}
726
727}
Junio C Hamano9d971152012-12-19 00:43:11728asciidoc.install();
Junio C Hamano7bd050f2011-09-22 06:32:22729/*]]>*/
730</script>
Junio C Hamano2bd8a742009-12-01 21:16:59731</head>
Junio C Hamano9d971152012-12-19 00:43:11732<body class="article">
Junio C Hamano2bd8a742009-12-01 21:16:59733<div id="header">
734<h1>Fighting regressions with git bisect</h1>
735<span id="author">Christian Couder</span><br />
Junio C Hamano9d971152012-12-19 00:43:11736<span id="email"><code>&lt;<a href="mailto:chriscool@tuxfamily.org">chriscool@tuxfamily.org</a>&gt;</code></span><br />
Junio C Hamano103b5722011-01-31 05:03:45737<span id="revdate">2009/11/08</span>
Junio C Hamano2bd8a742009-12-01 21:16:59738</div>
Junio C Hamano7bd050f2011-09-22 06:32:22739<div id="content">
Junio C Hamano9d971152012-12-19 00:43:11740<div class="sect1">
Junio C Hamano2bd8a742009-12-01 21:16:59741<h2 id="_abstract">Abstract</h2>
742<div class="sectionbody">
Junio C Hamano103b5722011-01-31 05:03:45743<div class="paragraph"><p>"git bisect" enables software users and developers to easily find the
Junio C Hamano2bd8a742009-12-01 21:16:59744commit that introduced a regression. We show why it is important to
745have good tools to fight regressions. We describe how "git bisect"
746works from the outside and the algorithms it uses inside. Then we
747explain how to take advantage of "git bisect" to improve current
748practices. And we discuss how "git bisect" could improve in the
749future.</p></div>
750</div>
Junio C Hamano9d971152012-12-19 00:43:11751</div>
752<div class="sect1">
Junio C Hamano2bd8a742009-12-01 21:16:59753<h2 id="_introduction_to_git_bisect">Introduction to "git bisect"</h2>
754<div class="sectionbody">
Junio C Hamano103b5722011-01-31 05:03:45755<div class="paragraph"><p>Git is a Distributed Version Control system (DVCS) created by Linus
Junio C Hamano2bd8a742009-12-01 21:16:59756Torvalds and maintained by Junio Hamano.</p></div>
Junio C Hamano103b5722011-01-31 05:03:45757<div class="paragraph"><p>In Git like in many other Version Control Systems (VCS), the different
Junio C Hamano2bd8a742009-12-01 21:16:59758states of the data that is managed by the system are called
759commits. And, as VCS are mostly used to manage software source code,
760sometimes "interesting" changes of behavior in the software are
761introduced in some commits.</p></div>
Junio C Hamano103b5722011-01-31 05:03:45762<div class="paragraph"><p>In fact people are specially interested in commits that introduce a
Junio C Hamano2bd8a742009-12-01 21:16:59763"bad" behavior, called a bug or a regression. They are interested in
764these commits because a commit (hopefully) contains a very small set
Junio C Hamano103b5722011-01-31 05:03:45765of source code changes. And it&#8217;s much easier to understand and
Junio C Hamano2bd8a742009-12-01 21:16:59766properly fix a problem when you only need to check a very small set of
Junio C Hamano103b5722011-01-31 05:03:45767changes, than when you don&#8217;t know where look in the first place.</p></div>
768<div class="paragraph"><p>So to help people find commits that introduce a "bad" behavior, the
Junio C Hamano2bd8a742009-12-01 21:16:59769"git bisect" set of commands was invented. And it follows of course
770that in "git bisect" parlance, commits where the "interesting
771behavior" is present are called "bad" commits, while other commits are
772called "good" commits. And a commit that introduce the behavior we are
773interested in is called a "first bad commit". Note that there could be
774more than one "first bad commit" in the commit space we are searching.</p></div>
Junio C Hamano103b5722011-01-31 05:03:45775<div class="paragraph"><p>So "git bisect" is designed to help find a "first bad commit". And to
Junio C Hamano2bd8a742009-12-01 21:16:59776be as efficient as possible, it tries to perform a binary search.</p></div>
777</div>
Junio C Hamano9d971152012-12-19 00:43:11778</div>
779<div class="sect1">
Junio C Hamano2bd8a742009-12-01 21:16:59780<h2 id="_fighting_regressions_overview">Fighting regressions overview</h2>
781<div class="sectionbody">
Junio C Hamano9d971152012-12-19 00:43:11782<div class="sect2">
783<h3 id="_regressions_a_big_problem">Regressions: a big problem</h3>
Junio C Hamano103b5722011-01-31 05:03:45784<div class="paragraph"><p>Regressions are a big problem in the software industry. But it&#8217;s
Junio C Hamano2bd8a742009-12-01 21:16:59785difficult to put some real numbers behind that claim.</p></div>
Junio C Hamano103b5722011-01-31 05:03:45786<div class="paragraph"><p>There are some numbers about bugs in general, like a NIST study in
Junio C Hamano2bd8a742009-12-01 21:16:597872002 <a href="#1">[1]</a> that said:</p></div>
788<div class="quoteblock">
Junio C Hamano9d971152012-12-19 00:43:11789<div class="content">
Junio C Hamano103b5722011-01-31 05:03:45790<div class="paragraph"><p>Software bugs, or errors, are so prevalent and so detrimental that
Junio C Hamano2bd8a742009-12-01 21:16:59791they cost the U.S. economy an estimated $59.5 billion annually, or
792about 0.6 percent of the gross domestic product, according to a newly
Junio C Hamano103b5722011-01-31 05:03:45793released study commissioned by the Department of Commerce&#8217;s National
Junio C Hamano2bd8a742009-12-01 21:16:59794Institute of Standards and Technology (NIST). At the national level,
795over half of the costs are borne by software users and the remainder
796by software developers/vendors. The study also found that, although
797all errors cannot be removed, more than a third of these costs, or an
798estimated $22.2 billion, could be eliminated by an improved testing
799infrastructure that enables earlier and more effective identification
800and removal of software defects. These are the savings associated with
801finding an increased percentage (but not 100 percent) of errors closer
802to the development stages in which they are introduced. Currently,
803over half of all errors are not found until "downstream" in the
804development process or during post-sale software use.</p></div>
Junio C Hamano103b5722011-01-31 05:03:45805</div>
Junio C Hamano9d971152012-12-19 00:43:11806<div class="attribution">
Junio C Hamano103b5722011-01-31 05:03:45807</div></div>
808<div class="paragraph"><p>And then:</p></div>
Junio C Hamano2bd8a742009-12-01 21:16:59809<div class="quoteblock">
Junio C Hamano9d971152012-12-19 00:43:11810<div class="content">
Junio C Hamano103b5722011-01-31 05:03:45811<div class="paragraph"><p>Software developers already spend approximately 80 percent of
Junio C Hamano2bd8a742009-12-01 21:16:59812development costs on identifying and correcting defects, and yet few
813products of any type other than software are shipped with such high
814levels of errors.</p></div>
Junio C Hamano103b5722011-01-31 05:03:45815</div>
Junio C Hamano9d971152012-12-19 00:43:11816<div class="attribution">
Junio C Hamano103b5722011-01-31 05:03:45817</div></div>
818<div class="paragraph"><p>Eventually the conclusion started with:</p></div>
Junio C Hamano2bd8a742009-12-01 21:16:59819<div class="quoteblock">
Junio C Hamano9d971152012-12-19 00:43:11820<div class="content">
Junio C Hamano103b5722011-01-31 05:03:45821<div class="paragraph"><p>The path to higher software quality is significantly improved software
Junio C Hamano2bd8a742009-12-01 21:16:59822testing.</p></div>
Junio C Hamano103b5722011-01-31 05:03:45823</div>
Junio C Hamano9d971152012-12-19 00:43:11824<div class="attribution">
Junio C Hamano103b5722011-01-31 05:03:45825</div></div>
826<div class="paragraph"><p>There are other estimates saying that 80% of the cost related to
Junio C Hamano2bd8a742009-12-01 21:16:59827software is about maintenance <a href="#2">[2]</a>.</p></div>
Junio C Hamano103b5722011-01-31 05:03:45828<div class="paragraph"><p>Though, according to Wikipedia <a href="#3">[3]</a>:</p></div>
Junio C Hamano2bd8a742009-12-01 21:16:59829<div class="quoteblock">
Junio C Hamano9d971152012-12-19 00:43:11830<div class="content">
Junio C Hamano103b5722011-01-31 05:03:45831<div class="paragraph"><p>A common perception of maintenance is that it is merely fixing
Junio C Hamano2bd8a742009-12-01 21:16:59832bugs. However, studies and surveys over the years have indicated that
833the majority, over 80%, of the maintenance effort is used for
834non-corrective actions (Pigosky 1997). This perception is perpetuated
835by users submitting problem reports that in reality are functionality
836enhancements to the system.</p></div>
Junio C Hamano103b5722011-01-31 05:03:45837</div>
Junio C Hamano9d971152012-12-19 00:43:11838<div class="attribution">
Junio C Hamano103b5722011-01-31 05:03:45839</div></div>
840<div class="paragraph"><p>But we can guess that improving on existing software is very costly
Junio C Hamano2bd8a742009-12-01 21:16:59841because you have to watch out for regressions. At least this would
842make the above studies consistent among themselves.</p></div>
Junio C Hamano103b5722011-01-31 05:03:45843<div class="paragraph"><p>Of course some kind of software is developed, then used during some
Junio C Hamano2bd8a742009-12-01 21:16:59844time without being improved on much, and then finally thrown away. In
845this case, of course, regressions may not be a big problem. But on the
846other hand, there is a lot of big software that is continually
847developed and maintained during years or even tens of years by a lot
848of people. And as there are often many people who depend (sometimes
849critically) on such software, regressions are a really big problem.</p></div>
Junio C Hamano103b5722011-01-31 05:03:45850<div class="paragraph"><p>One such software is the linux kernel. And if we look at the linux
Junio C Hamano2bd8a742009-12-01 21:16:59851kernel, we can see that a lot of time and effort is spent to fight
852regressions. The release cycle start with a 2 weeks long merge
853window. Then the first release candidate (rc) version is tagged. And
854after that about 7 or 8 more rc versions will appear with around one
855week between each of them, before the final release.</p></div>
Junio C Hamano103b5722011-01-31 05:03:45856<div class="paragraph"><p>The time between the first rc release and the final release is
Junio C Hamano2bd8a742009-12-01 21:16:59857supposed to be used to test rc versions and fight bugs and especially
858regressions. And this time is more than 80% of the release cycle
859time. But this is not the end of the fight yet, as of course it
860continues after the release.</p></div>
Junio C Hamano103b5722011-01-31 05:03:45861<div class="paragraph"><p>And then this is what Ingo Molnar (a well known linux kernel
Junio C Hamano2bd8a742009-12-01 21:16:59862developer) says about his use of git bisect:</p></div>
863<div class="quoteblock">
Junio C Hamano9d971152012-12-19 00:43:11864<div class="content">
Junio C Hamano103b5722011-01-31 05:03:45865<div class="paragraph"><p>I most actively use it during the merge window (when a lot of trees
Junio C Hamano2bd8a742009-12-01 21:16:59866get merged upstream and when the influx of bugs is the highest) - and
867yes, there have been cases that i used it multiple times a day. My
868average is roughly once a day.</p></div>
Junio C Hamano103b5722011-01-31 05:03:45869</div>
Junio C Hamano9d971152012-12-19 00:43:11870<div class="attribution">
Junio C Hamano103b5722011-01-31 05:03:45871</div></div>
872<div class="paragraph"><p>So regressions are fought all the time by developers, and indeed it is
Junio C Hamano2bd8a742009-12-01 21:16:59873well known that bugs should be fixed as soon as possible, so as soon
Junio C Hamano103b5722011-01-31 05:03:45874as they are found. That&#8217;s why it is interesting to have good tools for
Junio C Hamano2bd8a742009-12-01 21:16:59875this purpose.</p></div>
Junio C Hamano9d971152012-12-19 00:43:11876</div>
877<div class="sect2">
878<h3 id="_other_tools_to_fight_regressions">Other tools to fight regressions</h3>
Junio C Hamano103b5722011-01-31 05:03:45879<div class="paragraph"><p>So what are the tools used to fight regressions? They are nearly the
Junio C Hamano2bd8a742009-12-01 21:16:59880same as those used to fight regular bugs. The only specific tools are
881test suites and tools similar as "git bisect".</p></div>
Junio C Hamano103b5722011-01-31 05:03:45882<div class="paragraph"><p>Test suites are very nice. But when they are used alone, they are
Junio C Hamano2bd8a742009-12-01 21:16:59883supposed to be used so that all the tests are checked after each
884commit. This means that they are not very efficient, because many
885tests are run for no interesting result, and they suffer from
886combinational explosion.</p></div>
Junio C Hamano103b5722011-01-31 05:03:45887<div class="paragraph"><p>In fact the problem is that big software often has many different
Junio C Hamano2bd8a742009-12-01 21:16:59888configuration options and that each test case should pass for each
889configuration after each commit. So if you have for each release: N
890configurations, M commits and T test cases, you should perform:</p></div>
891<div class="listingblock">
892<div class="content">
Junio C Hamano9d971152012-12-19 00:43:11893<pre><code>N * M * T tests</code></pre>
Junio C Hamano2bd8a742009-12-01 21:16:59894</div></div>
Junio C Hamano103b5722011-01-31 05:03:45895<div class="paragraph"><p>where N, M and T are all growing with the size your software.</p></div>
896<div class="paragraph"><p>So very soon it will not be possible to completely test everything.</p></div>
897<div class="paragraph"><p>And if some bugs slip through your test suite, then you can add a test
Junio C Hamano2bd8a742009-12-01 21:16:59898to your test suite. But if you want to use your new improved test
899suite to find where the bug slipped in, then you will either have to
900emulate a bisection process or you will perhaps bluntly test each
901commit backward starting from the "bad" commit you have which may be
902very wasteful.</p></div>
903</div>
Junio C Hamano9d971152012-12-19 00:43:11904</div>
905</div>
906<div class="sect1">
Junio C Hamano2bd8a742009-12-01 21:16:59907<h2 id="_git_bisect_overview">"git bisect" overview</h2>
908<div class="sectionbody">
Junio C Hamano9d971152012-12-19 00:43:11909<div class="sect2">
910<h3 id="_starting_a_bisection">Starting a bisection</h3>
Junio C Hamano103b5722011-01-31 05:03:45911<div class="paragraph"><p>The first "git bisect" subcommand to use is "git bisect start" to
Junio C Hamano2bd8a742009-12-01 21:16:59912start the search. Then bounds must be set to limit the commit
913space. This is done usually by giving one "bad" and at least one
914"good" commit. They can be passed in the initial call to "git bisect
915start" like this:</p></div>
916<div class="listingblock">
917<div class="content">
Junio C Hamano9d971152012-12-19 00:43:11918<pre><code>$ git bisect start [BAD [GOOD...]]</code></pre>
Junio C Hamano2bd8a742009-12-01 21:16:59919</div></div>
Junio C Hamano103b5722011-01-31 05:03:45920<div class="paragraph"><p>or they can be set using:</p></div>
Junio C Hamano2bd8a742009-12-01 21:16:59921<div class="listingblock">
922<div class="content">
Junio C Hamano9d971152012-12-19 00:43:11923<pre><code>$ git bisect bad [COMMIT]</code></pre>
Junio C Hamano2bd8a742009-12-01 21:16:59924</div></div>
Junio C Hamano103b5722011-01-31 05:03:45925<div class="paragraph"><p>and:</p></div>
Junio C Hamano2bd8a742009-12-01 21:16:59926<div class="listingblock">
927<div class="content">
Junio C Hamano9d971152012-12-19 00:43:11928<pre><code>$ git bisect good [COMMIT...]</code></pre>
Junio C Hamano2bd8a742009-12-01 21:16:59929</div></div>
Junio C Hamano103b5722011-01-31 05:03:45930<div class="paragraph"><p>where BAD, GOOD and COMMIT are all names that can be resolved to a
Junio C Hamano2bd8a742009-12-01 21:16:59931commit.</p></div>
Junio C Hamano103b5722011-01-31 05:03:45932<div class="paragraph"><p>Then "git bisect" will checkout a commit of its choosing and ask the
Junio C Hamano2bd8a742009-12-01 21:16:59933user to test it, like this:</p></div>
934<div class="listingblock">
935<div class="content">
Junio C Hamano9d971152012-12-19 00:43:11936<pre><code>$ git bisect start v2.6.27 v2.6.25
Junio C Hamano2bd8a742009-12-01 21:16:59937Bisecting: 10928 revisions left to test after this (roughly 14 steps)
Junio C Hamano9d971152012-12-19 00:43:11938[2ec65f8b89ea003c27ff7723525a2ee335a2b393] x86: clean up using max_low_pfn on 32-bit</code></pre>
Junio C Hamano2bd8a742009-12-01 21:16:59939</div></div>
Junio C Hamano103b5722011-01-31 05:03:45940<div class="paragraph"><p>Note that the example that we will use is really a toy example, we
Junio C Hamano2bd8a742009-12-01 21:16:59941will be looking for the first commit that has a version like
942"2.6.26-something", that is the commit that has a "SUBLEVEL = 26" line
943in the top level Makefile. This is a toy example because there are
944better ways to find this commit with git than using "git bisect" (for
945example "git blame" or "git log -S&lt;string&gt;").</p></div>
Junio C Hamano9d971152012-12-19 00:43:11946</div>
947<div class="sect2">
948<h3 id="_driving_a_bisection_manually">Driving a bisection manually</h3>
Junio C Hamano103b5722011-01-31 05:03:45949<div class="paragraph"><p>At this point there are basically 2 ways to drive the search. It can
Junio C Hamano2bd8a742009-12-01 21:16:59950be driven manually by the user or it can be driven automatically by a
951script or a command.</p></div>
Junio C Hamano103b5722011-01-31 05:03:45952<div class="paragraph"><p>If the user is driving it, then at each step of the search, the user
Junio C Hamano2bd8a742009-12-01 21:16:59953will have to test the current commit and say if it is "good" or "bad"
954using the "git bisect good" or "git bisect bad" commands respectively
955that have been described above. For example:</p></div>
956<div class="listingblock">
957<div class="content">
Junio C Hamano9d971152012-12-19 00:43:11958<pre><code>$ git bisect bad
Junio C Hamano2bd8a742009-12-01 21:16:59959Bisecting: 5480 revisions left to test after this (roughly 13 steps)
Junio C Hamano9d971152012-12-19 00:43:11960[66c0b394f08fd89236515c1c84485ea712a157be] KVM: kill file-&gt;f_count abuse in kvm</code></pre>
Junio C Hamano2bd8a742009-12-01 21:16:59961</div></div>
Junio C Hamano103b5722011-01-31 05:03:45962<div class="paragraph"><p>And after a few more steps like that, "git bisect" will eventually
Junio C Hamano2bd8a742009-12-01 21:16:59963find a first bad commit:</p></div>
964<div class="listingblock">
965<div class="content">
Junio C Hamano9d971152012-12-19 00:43:11966<pre><code>$ git bisect bad
Junio C Hamano2bd8a742009-12-01 21:16:599672ddcca36c8bcfa251724fe342c8327451988be0d is the first bad commit
968commit 2ddcca36c8bcfa251724fe342c8327451988be0d
969Author: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
970Date: Sat May 3 11:59:44 2008 -0700
971
972 Linux 2.6.26-rc1
973
Junio C Hamano9d971152012-12-19 00:43:11974:100644 100644 5cf82581... 4492984e... M Makefile</code></pre>
Junio C Hamano2bd8a742009-12-01 21:16:59975</div></div>
Junio C Hamano103b5722011-01-31 05:03:45976<div class="paragraph"><p>At this point we can see what the commit does, check it out (if it&#8217;s
Junio C Hamano2bd8a742009-12-01 21:16:59977not already checked out) or tinker with it, for example:</p></div>
978<div class="listingblock">
979<div class="content">
Junio C Hamano9d971152012-12-19 00:43:11980<pre><code>$ git show HEAD
Junio C Hamano2bd8a742009-12-01 21:16:59981commit 2ddcca36c8bcfa251724fe342c8327451988be0d
982Author: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
983Date: Sat May 3 11:59:44 2008 -0700
984
985 Linux 2.6.26-rc1
986
987diff --git a/Makefile b/Makefile
988index 5cf8258..4492984 100644
989--- a/Makefile
990+++ b/Makefile
991@@ -1,7 +1,7 @@
992 VERSION = 2
993 PATCHLEVEL = 6
994-SUBLEVEL = 25
995-EXTRAVERSION =
996+SUBLEVEL = 26
997+EXTRAVERSION = -rc1
998 NAME = Funky Weasel is Jiggy wit it
999
Junio C Hamano9d971152012-12-19 00:43:111000 # *DOCUMENTATION*</code></pre>
Junio C Hamano2bd8a742009-12-01 21:16:591001</div></div>
Junio C Hamano103b5722011-01-31 05:03:451002<div class="paragraph"><p>And when we are finished we can use "git bisect reset" to go back to
Junio C Hamano2bd8a742009-12-01 21:16:591003the branch we were in before we started bisecting:</p></div>
1004<div class="listingblock">
1005<div class="content">
Junio C Hamano9d971152012-12-19 00:43:111006<pre><code>$ git bisect reset
Junio C Hamano2bd8a742009-12-01 21:16:591007Checking out files: 100% (21549/21549), done.
1008Previous HEAD position was 2ddcca3... Linux 2.6.26-rc1
Junio C Hamano9d971152012-12-19 00:43:111009Switched to branch 'master'</code></pre>
Junio C Hamano2bd8a742009-12-01 21:16:591010</div></div>
Junio C Hamano9d971152012-12-19 00:43:111011</div>
1012<div class="sect2">
1013<h3 id="_driving_a_bisection_automatically">Driving a bisection automatically</h3>
Junio C Hamano103b5722011-01-31 05:03:451014<div class="paragraph"><p>The other way to drive the bisection process is to tell "git bisect"
Junio C Hamano2bd8a742009-12-01 21:16:591015to launch a script or command at each bisection step to know if the
1016current commit is "good" or "bad". To do that, we use the "git bisect
1017run" command. For example:</p></div>
1018<div class="listingblock">
1019<div class="content">
Junio C Hamano9d971152012-12-19 00:43:111020<pre><code>$ git bisect start v2.6.27 v2.6.25
Junio C Hamano2bd8a742009-12-01 21:16:591021Bisecting: 10928 revisions left to test after this (roughly 14 steps)
1022[2ec65f8b89ea003c27ff7723525a2ee335a2b393] x86: clean up using max_low_pfn on 32-bit
1023$
1024$ git bisect run grep '^SUBLEVEL = 25' Makefile
1025running grep ^SUBLEVEL = 25 Makefile
1026Bisecting: 5480 revisions left to test after this (roughly 13 steps)
1027[66c0b394f08fd89236515c1c84485ea712a157be] KVM: kill file-&gt;f_count abuse in kvm
1028running grep ^SUBLEVEL = 25 Makefile
1029SUBLEVEL = 25
1030Bisecting: 2740 revisions left to test after this (roughly 12 steps)
1031[671294719628f1671faefd4882764886f8ad08cb] V4L/DVB(7879): Adding cx18 Support for mxl5005s
1032...
1033...
1034running grep ^SUBLEVEL = 25 Makefile
1035Bisecting: 0 revisions left to test after this (roughly 0 steps)
1036[2ddcca36c8bcfa251724fe342c8327451988be0d] Linux 2.6.26-rc1
1037running grep ^SUBLEVEL = 25 Makefile
10382ddcca36c8bcfa251724fe342c8327451988be0d is the first bad commit
1039commit 2ddcca36c8bcfa251724fe342c8327451988be0d
1040Author: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
1041Date: Sat May 3 11:59:44 2008 -0700
1042
1043 Linux 2.6.26-rc1
1044
Junio C Hamanof2b74942012-11-20 21:06:261045:100644 100644 5cf82581... 4492984e... M Makefile
Junio C Hamano9d971152012-12-19 00:43:111046bisect run success</code></pre>
Junio C Hamano2bd8a742009-12-01 21:16:591047</div></div>
Junio C Hamano103b5722011-01-31 05:03:451048<div class="paragraph"><p>In this example, we passed "grep <em>^SUBLEVEL = 25</em> Makefile" as
Junio C Hamano2bd8a742009-12-01 21:16:591049parameter to "git bisect run". This means that at each step, the grep
1050command we passed will be launched. And if it exits with code 0 (that
1051means success) then git bisect will mark the current state as
1052"good". If it exits with code 1 (or any code between 1 and 127
1053included, except the special code 125), then the current state will be
1054marked as "bad".</p></div>
Junio C Hamano103b5722011-01-31 05:03:451055<div class="paragraph"><p>Exit code between 128 and 255 are special to "git bisect run". They
Junio C Hamano2bd8a742009-12-01 21:16:591056make it stop immediately the bisection process. This is useful for
1057example if the command passed takes too long to complete, because you
1058can kill it with a signal and it will stop the bisection process.</p></div>
Junio C Hamano103b5722011-01-31 05:03:451059<div class="paragraph"><p>It can also be useful in scripts passed to "git bisect run" to "exit
Junio C Hamano2bd8a742009-12-01 21:16:591060255" if some very abnormal situation is detected.</p></div>
Junio C Hamano9d971152012-12-19 00:43:111061</div>
1062<div class="sect2">
1063<h3 id="_avoiding_untestable_commits">Avoiding untestable commits</h3>
Junio C Hamano103b5722011-01-31 05:03:451064<div class="paragraph"><p>Sometimes it happens that the current state cannot be tested, for
Junio C Hamano2bd8a742009-12-01 21:16:591065example if it does not compile because there was a bug preventing it
1066at that time. This is what the special exit code 125 is for. It tells
1067"git bisect run" that the current commit should be marked as
1068untestable and that another one should be chosen and checked out.</p></div>
Junio C Hamano103b5722011-01-31 05:03:451069<div class="paragraph"><p>If the bisection process is driven manually, you can use "git bisect
Junio C Hamano2bd8a742009-12-01 21:16:591070skip" to do the same thing. (In fact the special exit code 125 makes
1071"git bisect run" use "git bisect skip" in the background.)</p></div>
Junio C Hamano103b5722011-01-31 05:03:451072<div class="paragraph"><p>Or if you want more control, you can inspect the current state using
Junio C Hamano2bd8a742009-12-01 21:16:591073for example "git bisect visualize". It will launch gitk (or "git log"
1074if the DISPLAY environment variable is not set) to help you find a
1075better bisection point.</p></div>
Junio C Hamano103b5722011-01-31 05:03:451076<div class="paragraph"><p>Either way, if you have a string of untestable commits, it might
Junio C Hamano2bd8a742009-12-01 21:16:591077happen that the regression you are looking for has been introduced by
Junio C Hamano103b5722011-01-31 05:03:451078one of these untestable commits. In this case it&#8217;s not possible to
Junio C Hamano2bd8a742009-12-01 21:16:591079tell for sure which commit introduced the regression.</p></div>
Junio C Hamano103b5722011-01-31 05:03:451080<div class="paragraph"><p>So if you used "git bisect skip" (or the run script exited with
Junio C Hamano2bd8a742009-12-01 21:16:591081special code 125) you could get a result like this:</p></div>
1082<div class="listingblock">
1083<div class="content">
Junio C Hamano9d971152012-12-19 00:43:111084<pre><code>There are only 'skip'ped commits left to test.
Junio C Hamano2bd8a742009-12-01 21:16:591085The first bad commit could be any of:
108615722f2fa328eaba97022898a305ffc8172db6b1
108778e86cf3e850bd755bb71831f42e200626fbd1e0
1088e15b73ad3db9b48d7d1ade32f8cd23a751fe0ace
1089070eab2303024706f2924822bfec8b9847e4ac1b
Junio C Hamano9d971152012-12-19 00:43:111090We cannot bisect more!</code></pre>
Junio C Hamano2bd8a742009-12-01 21:16:591091</div></div>
Junio C Hamano9d971152012-12-19 00:43:111092</div>
1093<div class="sect2">
1094<h3 id="_saving_a_log_and_replaying_it">Saving a log and replaying it</h3>
Junio C Hamano103b5722011-01-31 05:03:451095<div class="paragraph"><p>If you want to show other people your bisection process, you can get a
Junio C Hamano2bd8a742009-12-01 21:16:591096log using for example:</p></div>
1097<div class="listingblock">
1098<div class="content">
Junio C Hamano9d971152012-12-19 00:43:111099<pre><code>$ git bisect log &gt; bisect_log.txt</code></pre>
Junio C Hamano2bd8a742009-12-01 21:16:591100</div></div>
Junio C Hamano103b5722011-01-31 05:03:451101<div class="paragraph"><p>And it is possible to replay it using:</p></div>
Junio C Hamano2bd8a742009-12-01 21:16:591102<div class="listingblock">
1103<div class="content">
Junio C Hamano9d971152012-12-19 00:43:111104<pre><code>$ git bisect replay bisect_log.txt</code></pre>
Junio C Hamano2bd8a742009-12-01 21:16:591105</div></div>
1106</div>
Junio C Hamano9d971152012-12-19 00:43:111107</div>
1108</div>
1109<div class="sect1">
Junio C Hamano2bd8a742009-12-01 21:16:591110<h2 id="_git_bisect_details">"git bisect" details</h2>
1111<div class="sectionbody">
Junio C Hamano9d971152012-12-19 00:43:111112<div class="sect2">
1113<h3 id="_bisection_algorithm">Bisection algorithm</h3>
Junio C Hamano103b5722011-01-31 05:03:451114<div class="paragraph"><p>As the Git commits form a directed acyclic graph (DAG), finding the
Junio C Hamano2bd8a742009-12-01 21:16:591115best bisection commit to test at each step is not so simple. Anyway
1116Linus found and implemented a "truly stupid" algorithm, later improved
1117by Junio Hamano, that works quite well.</p></div>
Junio C Hamano103b5722011-01-31 05:03:451118<div class="paragraph"><p>So the algorithm used by "git bisect" to find the best bisection
Junio C Hamano2bd8a742009-12-01 21:16:591119commit when there are no skipped commits is the following:</p></div>
Junio C Hamano103b5722011-01-31 05:03:451120<div class="paragraph"><p>1) keep only the commits that:</p></div>
1121<div class="paragraph"><p>a) are ancestor of the "bad" commit (including the "bad" commit itself),
Junio C Hamano2bd8a742009-12-01 21:16:591122b) are not ancestor of a "good" commit (excluding the "good" commits).</p></div>
Junio C Hamano103b5722011-01-31 05:03:451123<div class="paragraph"><p>This means that we get rid of the uninteresting commits in the DAG.</p></div>
1124<div class="paragraph"><p>For example if we start with a graph like this:</p></div>
Junio C Hamano2bd8a742009-12-01 21:16:591125<div class="listingblock">
1126<div class="content">
Junio C Hamano9d971152012-12-19 00:43:111127<pre><code>G-Y-G-W-W-W-X-X-X-X
Junio C Hamano2bd8a742009-12-01 21:16:591128 \ /
1129 W-W-B
1130 /
1131Y---G-W---W
1132 \ / \
1133Y-Y X-X-X-X
1134
Junio C Hamano9d971152012-12-19 00:43:111135-&gt; time goes this way -&gt;</code></pre>
Junio C Hamano2bd8a742009-12-01 21:16:591136</div></div>
Junio C Hamano103b5722011-01-31 05:03:451137<div class="paragraph"><p>where B is the "bad" commit, "G" are "good" commits and W, X, and Y
Junio C Hamano2bd8a742009-12-01 21:16:591138are other commits, we will get the following graph after this first
1139step:</p></div>
1140<div class="listingblock">
1141<div class="content">
Junio C Hamano9d971152012-12-19 00:43:111142<pre><code>W-W-W
Junio C Hamano2bd8a742009-12-01 21:16:591143 \
1144 W-W-B
1145 /
Junio C Hamano9d971152012-12-19 00:43:111146W---W</code></pre>
Junio C Hamano2bd8a742009-12-01 21:16:591147</div></div>
Junio C Hamano103b5722011-01-31 05:03:451148<div class="paragraph"><p>So only the W and B commits will be kept. Because commits X and Y will
Junio C Hamano2bd8a742009-12-01 21:16:591149have been removed by rules a) and b) respectively, and because commits
1150G are removed by rule b) too.</p></div>
Junio C Hamano103b5722011-01-31 05:03:451151<div class="paragraph"><p>Note for git users, that it is equivalent as keeping only the commit
Junio C Hamano2bd8a742009-12-01 21:16:591152given by:</p></div>
1153<div class="listingblock">
1154<div class="content">
Junio C Hamano9d971152012-12-19 00:43:111155<pre><code>git rev-list BAD --not GOOD1 GOOD2...</code></pre>
Junio C Hamano2bd8a742009-12-01 21:16:591156</div></div>
Junio C Hamano103b5722011-01-31 05:03:451157<div class="paragraph"><p>Also note that we don&#8217;t require the commits that are kept to be
Junio C Hamano2bd8a742009-12-01 21:16:591158descendants of a "good" commit. So in the following example, commits W
1159and Z will be kept:</p></div>
1160<div class="listingblock">
1161<div class="content">
Junio C Hamano9d971152012-12-19 00:43:111162<pre><code>G-W-W-W-B
Junio C Hamano2bd8a742009-12-01 21:16:591163 /
Junio C Hamano9d971152012-12-19 00:43:111164Z-Z</code></pre>
Junio C Hamano2bd8a742009-12-01 21:16:591165</div></div>
Junio C Hamano103b5722011-01-31 05:03:451166<div class="paragraph"><p>2) starting from the "good" ends of the graph, associate to each
Junio C Hamano2bd8a742009-12-01 21:16:591167commit the number of ancestors it has plus one</p></div>
Junio C Hamano103b5722011-01-31 05:03:451168<div class="paragraph"><p>For example with the following graph where H is the "bad" commit and A
Junio C Hamano2bd8a742009-12-01 21:16:591169and D are some parents of some "good" commits:</p></div>
1170<div class="listingblock">
1171<div class="content">
Junio C Hamano9d971152012-12-19 00:43:111172<pre><code>A-B-C
Junio C Hamano2bd8a742009-12-01 21:16:591173 \
1174 F-G-H
1175 /
Junio C Hamano9d971152012-12-19 00:43:111176D---E</code></pre>
Junio C Hamano2bd8a742009-12-01 21:16:591177</div></div>
Junio C Hamano103b5722011-01-31 05:03:451178<div class="paragraph"><p>this will give:</p></div>
Junio C Hamano2bd8a742009-12-01 21:16:591179<div class="listingblock">
1180<div class="content">
Junio C Hamano9d971152012-12-19 00:43:111181<pre><code>1 2 3
Junio C Hamano2bd8a742009-12-01 21:16:591182A-B-C
1183 \6 7 8
1184 F-G-H
11851 2/
Junio C Hamano9d971152012-12-19 00:43:111186D---E</code></pre>
Junio C Hamano2bd8a742009-12-01 21:16:591187</div></div>
Junio C Hamano103b5722011-01-31 05:03:451188<div class="paragraph"><p>3) associate to each commit: min(X, N - X)</p></div>
1189<div class="paragraph"><p>where X is the value associated to the commit in step 2) and N is the
Junio C Hamano2bd8a742009-12-01 21:16:591190total number of commits in the graph.</p></div>
Junio C Hamano103b5722011-01-31 05:03:451191<div class="paragraph"><p>In the above example we have N = 8, so this will give:</p></div>
Junio C Hamano2bd8a742009-12-01 21:16:591192<div class="listingblock">
1193<div class="content">
Junio C Hamano9d971152012-12-19 00:43:111194<pre><code>1 2 3
Junio C Hamano2bd8a742009-12-01 21:16:591195A-B-C
1196 \2 1 0
1197 F-G-H
11981 2/
Junio C Hamano9d971152012-12-19 00:43:111199D---E</code></pre>
Junio C Hamano2bd8a742009-12-01 21:16:591200</div></div>
Junio C Hamano103b5722011-01-31 05:03:451201<div class="paragraph"><p>4) the best bisection point is the commit with the highest associated
Junio C Hamano2bd8a742009-12-01 21:16:591202number</p></div>
Junio C Hamano103b5722011-01-31 05:03:451203<div class="paragraph"><p>So in the above example the best bisection point is commit C.</p></div>
1204<div class="paragraph"><p>5) note that some shortcuts are implemented to speed up the algorithm</p></div>
1205<div class="paragraph"><p>As we know N from the beginning, we know that min(X, N - X) can&#8217;t be
Junio C Hamano2bd8a742009-12-01 21:16:591206greater than N/2. So during steps 2) and 3), if we would associate N/2
1207to a commit, then we know this is the best bisection point. So in this
1208case we can just stop processing any other commit and return the
1209current commit.</p></div>
Junio C Hamano9d971152012-12-19 00:43:111210</div>
1211<div class="sect2">
1212<h3 id="_bisection_algorithm_debugging">Bisection algorithm debugging</h3>
Junio C Hamano103b5722011-01-31 05:03:451213<div class="paragraph"><p>For any commit graph, you can see the number associated with each
1214commit using "git rev-list --bisect-all".</p></div>
1215<div class="paragraph"><p>For example, for the above graph, a command like:</p></div>
Junio C Hamano2bd8a742009-12-01 21:16:591216<div class="listingblock">
1217<div class="content">
Junio C Hamano9d971152012-12-19 00:43:111218<pre><code>$ git rev-list --bisect-all BAD --not GOOD1 GOOD2</code></pre>
Junio C Hamano2bd8a742009-12-01 21:16:591219</div></div>
Junio C Hamano103b5722011-01-31 05:03:451220<div class="paragraph"><p>would output something like:</p></div>
Junio C Hamano2bd8a742009-12-01 21:16:591221<div class="listingblock">
1222<div class="content">
Junio C Hamano9d971152012-12-19 00:43:111223<pre><code>e15b73ad3db9b48d7d1ade32f8cd23a751fe0ace (dist=3)
Junio C Hamano2bd8a742009-12-01 21:16:59122415722f2fa328eaba97022898a305ffc8172db6b1 (dist=2)
122578e86cf3e850bd755bb71831f42e200626fbd1e0 (dist=2)
1226a1939d9a142de972094af4dde9a544e577ddef0e (dist=2)
1227070eab2303024706f2924822bfec8b9847e4ac1b (dist=1)
1228a3864d4f32a3bf5ed177ddef598490a08760b70d (dist=1)
1229a41baa717dd74f1180abf55e9341bc7a0bb9d556 (dist=1)
Junio C Hamano9d971152012-12-19 00:43:1112309e622a6dad403b71c40979743bb9d5be17b16bd6 (dist=0)</code></pre>
Junio C Hamano2bd8a742009-12-01 21:16:591231</div></div>
Junio C Hamano9d971152012-12-19 00:43:111232</div>
1233<div class="sect2">
1234<h3 id="_bisection_algorithm_discussed">Bisection algorithm discussed</h3>
Junio C Hamano103b5722011-01-31 05:03:451235<div class="paragraph"><p>First let&#8217;s define "best bisection point". We will say that a commit X
Junio C Hamano2bd8a742009-12-01 21:16:591236is a best bisection point or a best bisection commit if knowing its
1237state ("good" or "bad") gives as much information as possible whether
1238the state of the commit happens to be "good" or "bad".</p></div>
Junio C Hamano103b5722011-01-31 05:03:451239<div class="paragraph"><p>This means that the best bisection commits are the commits where the
Junio C Hamano2bd8a742009-12-01 21:16:591240following function is maximum:</p></div>
1241<div class="listingblock">
1242<div class="content">
Junio C Hamano9d971152012-12-19 00:43:111243<pre><code>f(X) = min(information_if_good(X), information_if_bad(X))</code></pre>
Junio C Hamano2bd8a742009-12-01 21:16:591244</div></div>
Junio C Hamano103b5722011-01-31 05:03:451245<div class="paragraph"><p>where information_if_good(X) is the information we get if X is good
Junio C Hamano2bd8a742009-12-01 21:16:591246and information_if_bad(X) is the information we get if X is bad.</p></div>
Junio C Hamano103b5722011-01-31 05:03:451247<div class="paragraph"><p>Now we will suppose that there is only one "first bad commit". This
Junio C Hamano2bd8a742009-12-01 21:16:591248means that all its descendants are "bad" and all the other commits are
1249"good". And we will suppose that all commits have an equal probability
1250of being good or bad, or of being the first bad commit, so knowing the
1251state of c commits gives always the same amount of information
1252wherever these c commits are on the graph and whatever c is. (So we
1253suppose that these commits being for example on a branch or near a
1254good or a bad commit does not give more or less information).</p></div>
Junio C Hamano103b5722011-01-31 05:03:451255<div class="paragraph"><p>Let&#8217;s also suppose that we have a cleaned up graph like one after step
Junio C Hamano2bd8a742009-12-01 21:16:5912561) in the bisection algorithm above. This means that we can measure
1257the information we get in terms of number of commit we can remove from
1258the graph..</p></div>
Junio C Hamano103b5722011-01-31 05:03:451259<div class="paragraph"><p>And let&#8217;s take a commit X in the graph.</p></div>
1260<div class="paragraph"><p>If X is found to be "good", then we know that its ancestors are all
Junio C Hamano2bd8a742009-12-01 21:16:591261"good", so we want to say that:</p></div>
1262<div class="listingblock">
1263<div class="content">
Junio C Hamano9d971152012-12-19 00:43:111264<pre><code>information_if_good(X) = number_of_ancestors(X) (TRUE)</code></pre>
Junio C Hamano2bd8a742009-12-01 21:16:591265</div></div>
Junio C Hamano103b5722011-01-31 05:03:451266<div class="paragraph"><p>And this is true because at step 1) b) we remove the ancestors of the
Junio C Hamano2bd8a742009-12-01 21:16:591267"good" commits.</p></div>
Junio C Hamano103b5722011-01-31 05:03:451268<div class="paragraph"><p>If X is found to be "bad", then we know that its descendants are all
Junio C Hamano2bd8a742009-12-01 21:16:591269"bad", so we want to say that:</p></div>
1270<div class="listingblock">
1271<div class="content">
Junio C Hamano9d971152012-12-19 00:43:111272<pre><code>information_if_bad(X) = number_of_descendants(X) (WRONG)</code></pre>
Junio C Hamano2bd8a742009-12-01 21:16:591273</div></div>
Junio C Hamano103b5722011-01-31 05:03:451274<div class="paragraph"><p>But this is wrong because at step 1) a) we keep only the ancestors of
Junio C Hamano2bd8a742009-12-01 21:16:591275the bad commit. So we get more information when a commit is marked as
1276"bad", because we also know that the ancestors of the previous "bad"
1277commit that are not ancestors of the new "bad" commit are not the
Junio C Hamano103b5722011-01-31 05:03:451278first bad commit. We don&#8217;t know if they are good or bad, but we know
Junio C Hamano2bd8a742009-12-01 21:16:591279that they are not the first bad commit because they are not ancestor
1280of the new "bad" commit.</p></div>
Junio C Hamano103b5722011-01-31 05:03:451281<div class="paragraph"><p>So when a commit is marked as "bad" we know we can remove all the
Junio C Hamano2bd8a742009-12-01 21:16:591282commits in the graph except those that are ancestors of the new "bad"
1283commit. This means that:</p></div>
1284<div class="listingblock">
1285<div class="content">
Junio C Hamano9d971152012-12-19 00:43:111286<pre><code>information_if_bad(X) = N - number_of_ancestors(X) (TRUE)</code></pre>
Junio C Hamano2bd8a742009-12-01 21:16:591287</div></div>
Junio C Hamano103b5722011-01-31 05:03:451288<div class="paragraph"><p>where N is the number of commits in the (cleaned up) graph.</p></div>
1289<div class="paragraph"><p>So in the end this means that to find the best bisection commits we
Junio C Hamano2bd8a742009-12-01 21:16:591290should maximize the function:</p></div>
1291<div class="listingblock">
1292<div class="content">
Junio C Hamano9d971152012-12-19 00:43:111293<pre><code>f(X) = min(number_of_ancestors(X), N - number_of_ancestors(X))</code></pre>
Junio C Hamano2bd8a742009-12-01 21:16:591294</div></div>
Junio C Hamano103b5722011-01-31 05:03:451295<div class="paragraph"><p>And this is nice because at step 2) we compute number_of_ancestors(X)
Junio C Hamano2bd8a742009-12-01 21:16:591296and so at step 3) we compute f(X).</p></div>
Junio C Hamano103b5722011-01-31 05:03:451297<div class="paragraph"><p>Let&#8217;s take the following graph as an example:</p></div>
Junio C Hamano2bd8a742009-12-01 21:16:591298<div class="listingblock">
1299<div class="content">
Junio C Hamano9d971152012-12-19 00:43:111300<pre><code> G-H-I-J
Junio C Hamano2bd8a742009-12-01 21:16:591301 / \
1302A-B-C-D-E-F O
1303 \ /
Junio C Hamano9d971152012-12-19 00:43:111304 K-L-M-N</code></pre>
Junio C Hamano2bd8a742009-12-01 21:16:591305</div></div>
Junio C Hamano103b5722011-01-31 05:03:451306<div class="paragraph"><p>If we compute the following non optimal function on it:</p></div>
Junio C Hamano2bd8a742009-12-01 21:16:591307<div class="listingblock">
1308<div class="content">
Junio C Hamano9d971152012-12-19 00:43:111309<pre><code>g(X) = min(number_of_ancestors(X), number_of_descendants(X))</code></pre>
Junio C Hamano2bd8a742009-12-01 21:16:591310</div></div>
Junio C Hamano103b5722011-01-31 05:03:451311<div class="paragraph"><p>we get:</p></div>
Junio C Hamano2bd8a742009-12-01 21:16:591312<div class="listingblock">
1313<div class="content">
Junio C Hamano9d971152012-12-19 00:43:111314<pre><code> 4 3 2 1
Junio C Hamano2bd8a742009-12-01 21:16:591315 G-H-I-J
13161 2 3 4 5 6/ \0
1317A-B-C-D-E-F O
1318 \ /
1319 K-L-M-N
Junio C Hamano9d971152012-12-19 00:43:111320 4 3 2 1</code></pre>
Junio C Hamano2bd8a742009-12-01 21:16:591321</div></div>
Junio C Hamano103b5722011-01-31 05:03:451322<div class="paragraph"><p>but with the algorithm used by git bisect we get:</p></div>
Junio C Hamano2bd8a742009-12-01 21:16:591323<div class="listingblock">
1324<div class="content">
Junio C Hamano9d971152012-12-19 00:43:111325<pre><code> 7 7 6 5
Junio C Hamano2bd8a742009-12-01 21:16:591326 G-H-I-J
13271 2 3 4 5 6/ \0
1328A-B-C-D-E-F O
1329 \ /
1330 K-L-M-N
Junio C Hamano9d971152012-12-19 00:43:111331 7 7 6 5</code></pre>
Junio C Hamano2bd8a742009-12-01 21:16:591332</div></div>
Junio C Hamano103b5722011-01-31 05:03:451333<div class="paragraph"><p>So we chose G, H, K or L as the best bisection point, which is better
Junio C Hamano2bd8a742009-12-01 21:16:591334than F. Because if for example L is bad, then we will know not only
1335that L, M and N are bad but also that G, H, I and J are not the first
1336bad commit (since we suppose that there is only one first bad commit
1337and it must be an ancestor of L).</p></div>
Junio C Hamano103b5722011-01-31 05:03:451338<div class="paragraph"><p>So the current algorithm seems to be the best possible given what we
Junio C Hamano2bd8a742009-12-01 21:16:591339initially supposed.</p></div>
Junio C Hamano9d971152012-12-19 00:43:111340</div>
1341<div class="sect2">
1342<h3 id="_skip_algorithm">Skip algorithm</h3>
Junio C Hamano103b5722011-01-31 05:03:451343<div class="paragraph"><p>When some commits have been skipped (using "git bisect skip"), then
Junio C Hamano2bd8a742009-12-01 21:16:591344the bisection algorithm is the same for step 1) to 3). But then we use
1345roughly the following steps:</p></div>
Junio C Hamano103b5722011-01-31 05:03:451346<div class="paragraph"><p>6) sort the commit by decreasing associated value</p></div>
1347<div class="paragraph"><p>7) if the first commit has not been skipped, we can return it and stop
Junio C Hamano2bd8a742009-12-01 21:16:591348here</p></div>
Junio C Hamano103b5722011-01-31 05:03:451349<div class="paragraph"><p>8) otherwise filter out all the skipped commits in the sorted list</p></div>
1350<div class="paragraph"><p>9) use a pseudo random number generator (PRNG) to generate a random
Junio C Hamano2bd8a742009-12-01 21:16:591351number between 0 and 1</p></div>
Junio C Hamano103b5722011-01-31 05:03:451352<div class="paragraph"><p>10) multiply this random number with its square root to bias it toward
Junio C Hamano2bd8a742009-12-01 21:16:5913530</p></div>
Junio C Hamano103b5722011-01-31 05:03:451354<div class="paragraph"><p>11) multiply the result by the number of commits in the filtered list
Junio C Hamano2bd8a742009-12-01 21:16:591355to get an index into this list</p></div>
Junio C Hamano103b5722011-01-31 05:03:451356<div class="paragraph"><p>12) return the commit at the computed index</p></div>
Junio C Hamano9d971152012-12-19 00:43:111357</div>
1358<div class="sect2">
1359<h3 id="_skip_algorithm_discussed">Skip algorithm discussed</h3>
Junio C Hamano103b5722011-01-31 05:03:451360<div class="paragraph"><p>After step 7) (in the skip algorithm), we could check if the second
Junio C Hamano2bd8a742009-12-01 21:16:591361commit has been skipped and return it if it is not the case. And in
1362fact that was the algorithm we used from when "git bisect skip" was
1363developed in git version 1.5.4 (released on February 1st 2008) until
1364git version 1.6.4 (released July 29th 2009).</p></div>
Junio C Hamano103b5722011-01-31 05:03:451365<div class="paragraph"><p>But Ingo Molnar and H. Peter Anvin (another well known linux kernel
Junio C Hamano2bd8a742009-12-01 21:16:591366developer) both complained that sometimes the best bisection points
1367all happened to be in an area where all the commits are
1368untestable. And in this case the user was asked to test many
1369untestable commits, which could be very inefficient.</p></div>
Junio C Hamano103b5722011-01-31 05:03:451370<div class="paragraph"><p>Indeed untestable commits are often untestable because a breakage was
Junio C Hamano2bd8a742009-12-01 21:16:591371introduced at one time, and that breakage was fixed only after many
1372other commits were introduced.</p></div>
Junio C Hamano103b5722011-01-31 05:03:451373<div class="paragraph"><p>This breakage is of course most of the time unrelated to the breakage
Junio C Hamano2bd8a742009-12-01 21:16:591374we are trying to locate in the commit graph. But it prevents us to
1375know if the interesting "bad behavior" is present or not.</p></div>
Junio C Hamano103b5722011-01-31 05:03:451376<div class="paragraph"><p>So it is a fact that commits near an untestable commit have a high
Junio C Hamano2bd8a742009-12-01 21:16:591377probability of being untestable themselves. And the best bisection
1378commits are often found together too (due to the bisection algorithm).</p></div>
Junio C Hamano103b5722011-01-31 05:03:451379<div class="paragraph"><p>This is why it is a bad idea to just chose the next best unskipped
Junio C Hamano2bd8a742009-12-01 21:16:591380bisection commit when the first one has been skipped.</p></div>
Junio C Hamano103b5722011-01-31 05:03:451381<div class="paragraph"><p>We found that most commits on the graph may give quite a lot of
Junio C Hamano2bd8a742009-12-01 21:16:591382information when they are tested. And the commits that will not on
1383average give a lot of information are the one near the good and bad
1384commits.</p></div>
Junio C Hamano103b5722011-01-31 05:03:451385<div class="paragraph"><p>So using a PRNG with a bias to favor commits away from the good and
Junio C Hamano2bd8a742009-12-01 21:16:591386bad commits looked like a good choice.</p></div>
Junio C Hamano103b5722011-01-31 05:03:451387<div class="paragraph"><p>One obvious improvement to this algorithm would be to look for a
Junio C Hamano2bd8a742009-12-01 21:16:591388commit that has an associated value near the one of the best bisection
1389commit, and that is on another branch, before using the PRNG. Because
1390if such a commit exists, then it is not very likely to be untestable
1391too, so it will probably give more information than a nearly randomly
1392chosen one.</p></div>
Junio C Hamano9d971152012-12-19 00:43:111393</div>
1394<div class="sect2">
1395<h3 id="_checking_merge_bases">Checking merge bases</h3>
Junio C Hamano103b5722011-01-31 05:03:451396<div class="paragraph"><p>There is another tweak in the bisection algorithm that has not been
Junio C Hamano2bd8a742009-12-01 21:16:591397described in the "bisection algorithm" above.</p></div>
Junio C Hamano103b5722011-01-31 05:03:451398<div class="paragraph"><p>We supposed in the previous examples that the "good" commits were
Junio C Hamano2bd8a742009-12-01 21:16:591399ancestors of the "bad" commit. But this is not a requirement of "git
1400bisect".</p></div>
Junio C Hamano103b5722011-01-31 05:03:451401<div class="paragraph"><p>Of course the "bad" commit cannot be an ancestor of a "good" commit,
Junio C Hamano2bd8a742009-12-01 21:16:591402because the ancestors of the good commits are supposed to be
1403"good". And all the "good" commits must be related to the bad commit.
1404They cannot be on a branch that has no link with the branch of the
1405"bad" commit. But it is possible for a good commit to be related to a
1406bad commit and yet not be neither one of its ancestor nor one of its
1407descendants.</p></div>
Junio C Hamano103b5722011-01-31 05:03:451408<div class="paragraph"><p>For example, there can be a "main" branch, and a "dev" branch that was
Junio C Hamano2bd8a742009-12-01 21:16:591409forked of the main branch at a commit named "D" like this:</p></div>
1410<div class="listingblock">
1411<div class="content">
Junio C Hamano9d971152012-12-19 00:43:111412<pre><code>A-B-C-D-E-F-G &lt;--main
Junio C Hamano2bd8a742009-12-01 21:16:591413 \
Junio C Hamano9d971152012-12-19 00:43:111414 H-I-J &lt;--dev</code></pre>
Junio C Hamano2bd8a742009-12-01 21:16:591415</div></div>
Junio C Hamano103b5722011-01-31 05:03:451416<div class="paragraph"><p>The commit "D" is called a "merge base" for branch "main" and "dev"
1417because it&#8217;s the best common ancestor for these branches for a merge.</p></div>
1418<div class="paragraph"><p>Now let&#8217;s suppose that commit J is bad and commit G is good and that
Junio C Hamano2bd8a742009-12-01 21:16:591419we apply the bisection algorithm like it has been previously
1420described.</p></div>
Junio C Hamano103b5722011-01-31 05:03:451421<div class="paragraph"><p>As described in step 1) b) of the bisection algorithm, we remove all
Junio C Hamano2bd8a742009-12-01 21:16:591422the ancestors of the good commits because they are supposed to be good
1423too.</p></div>
Junio C Hamano103b5722011-01-31 05:03:451424<div class="paragraph"><p>So we would be left with only:</p></div>
Junio C Hamano2bd8a742009-12-01 21:16:591425<div class="listingblock">
1426<div class="content">
Junio C Hamano9d971152012-12-19 00:43:111427<pre><code>H-I-J</code></pre>
Junio C Hamano2bd8a742009-12-01 21:16:591428</div></div>
Junio C Hamano103b5722011-01-31 05:03:451429<div class="paragraph"><p>But what happens if the first bad commit is "B" and if it has been
Junio C Hamano2bd8a742009-12-01 21:16:591430fixed in the "main" branch by commit "F"?</p></div>
Junio C Hamano103b5722011-01-31 05:03:451431<div class="paragraph"><p>The result of such a bisection would be that we would find that H is
1432the first bad commit, when in fact it&#8217;s B. So that would be wrong!</p></div>
1433<div class="paragraph"><p>And yes it can happen in practice that people working on one branch
Junio C Hamano2bd8a742009-12-01 21:16:591434are not aware that people working on another branch fixed a bug! It
1435could also happen that F fixed more than one bug or that it is a
1436revert of some big development effort that was not ready to be
1437released.</p></div>
Junio C Hamano103b5722011-01-31 05:03:451438<div class="paragraph"><p>In fact development teams often maintain both a development branch and
Junio C Hamano2bd8a742009-12-01 21:16:591439a maintenance branch, and it would be quite easy for them if "git
1440bisect" just worked when they want to bisect a regression on the
1441development branch that is not on the maintenance branch. They should
1442be able to start bisecting using:</p></div>
1443<div class="listingblock">
1444<div class="content">
Junio C Hamano9d971152012-12-19 00:43:111445<pre><code>$ git bisect start dev main</code></pre>
Junio C Hamano2bd8a742009-12-01 21:16:591446</div></div>
Junio C Hamano103b5722011-01-31 05:03:451447<div class="paragraph"><p>To enable that additional nice feature, when a bisection is started
Junio C Hamano2bd8a742009-12-01 21:16:591448and when some good commits are not ancestors of the bad commit, we
1449first compute the merge bases between the bad and the good commits and
1450we chose these merge bases as the first commits that will be checked
1451out and tested.</p></div>
Junio C Hamano103b5722011-01-31 05:03:451452<div class="paragraph"><p>If it happens that one merge base is bad, then the bisection process
Junio C Hamano2bd8a742009-12-01 21:16:591453is stopped with a message like:</p></div>
1454<div class="listingblock">
1455<div class="content">
Junio C Hamano9d971152012-12-19 00:43:111456<pre><code>The merge base BBBBBB is bad.
1457This means the bug has been fixed between BBBBBB and [GGGGGG,...].</code></pre>
Junio C Hamano2bd8a742009-12-01 21:16:591458</div></div>
Junio C Hamano103b5722011-01-31 05:03:451459<div class="paragraph"><p>where BBBBBB is the sha1 hash of the bad merge base and [GGGGGG,&#8230;]
Junio C Hamano2bd8a742009-12-01 21:16:591460is a comma separated list of the sha1 of the good commits.</p></div>
Junio C Hamano103b5722011-01-31 05:03:451461<div class="paragraph"><p>If some of the merge bases are skipped, then the bisection process
Junio C Hamano2bd8a742009-12-01 21:16:591462continues, but the following message is printed for each skipped merge
1463base:</p></div>
1464<div class="listingblock">
1465<div class="content">
Junio C Hamano9d971152012-12-19 00:43:111466<pre><code>Warning: the merge base between BBBBBB and [GGGGGG,...] must be skipped.
Junio C Hamano2bd8a742009-12-01 21:16:591467So we cannot be sure the first bad commit is between MMMMMM and BBBBBB.
Junio C Hamano9d971152012-12-19 00:43:111468We continue anyway.</code></pre>
Junio C Hamano2bd8a742009-12-01 21:16:591469</div></div>
Junio C Hamano103b5722011-01-31 05:03:451470<div class="paragraph"><p>where BBBBBB is the sha1 hash of the bad commit, MMMMMM is the sha1
Junio C Hamano2bd8a742009-12-01 21:16:591471hash of the merge base that is skipped and [GGGGGG,&#8230;] is a comma
1472separated list of the sha1 of the good commits.</p></div>
Junio C Hamano103b5722011-01-31 05:03:451473<div class="paragraph"><p>So if there is no bad merge base, the bisection process continues as
Junio C Hamano2bd8a742009-12-01 21:16:591474usual after this step.</p></div>
1475</div>
Junio C Hamano9d971152012-12-19 00:43:111476</div>
1477</div>
1478<div class="sect1">
Junio C Hamano2bd8a742009-12-01 21:16:591479<h2 id="_best_bisecting_practices">Best bisecting practices</h2>
1480<div class="sectionbody">
Junio C Hamano9d971152012-12-19 00:43:111481<div class="sect2">
1482<h3 id="_using_test_suites_and_git_bisect_together">Using test suites and git bisect together</h3>
Junio C Hamano103b5722011-01-31 05:03:451483<div class="paragraph"><p>If you both have a test suite and use git bisect, then it becomes less
Junio C Hamano2bd8a742009-12-01 21:16:591484important to check that all tests pass after each commit. Though of
1485course it is probably a good idea to have some checks to avoid
1486breaking too many things because it could make bisecting other bugs
1487more difficult.</p></div>
Junio C Hamano103b5722011-01-31 05:03:451488<div class="paragraph"><p>You can focus your efforts to check at a few points (for example rc
Junio C Hamano2bd8a742009-12-01 21:16:591489and beta releases) that all the T test cases pass for all the N
Junio C Hamano103b5722011-01-31 05:03:451490configurations. And when some tests don&#8217;t pass you can use "git
Junio C Hamano2bd8a742009-12-01 21:16:591491bisect" (or better "git bisect run"). So you should perform roughly:</p></div>
1492<div class="listingblock">
1493<div class="content">
Junio C Hamano9d971152012-12-19 00:43:111494<pre><code>c * N * T + b * M * log2(M) tests</code></pre>
Junio C Hamano2bd8a742009-12-01 21:16:591495</div></div>
Junio C Hamano103b5722011-01-31 05:03:451496<div class="paragraph"><p>where c is the number of rounds of test (so a small constant) and b is
Junio C Hamano2bd8a742009-12-01 21:16:591497the ratio of bug per commit (hopefully a small constant too).</p></div>
Junio C Hamano103b5722011-01-31 05:03:451498<div class="paragraph"><p>So of course it&#8217;s much better as it&#8217;s O(N * T) vs O(N * T * M) if
Junio C Hamano2bd8a742009-12-01 21:16:591499you would test everything after each commit.</p></div>
Junio C Hamano103b5722011-01-31 05:03:451500<div class="paragraph"><p>This means that test suites are good to prevent some bugs from being
Junio C Hamano2bd8a742009-12-01 21:16:591501committed and they are also quite good to tell you that you have some
1502bugs. But they are not so good to tell you where some bugs have been
1503introduced. To tell you that efficiently, git bisect is needed.</p></div>
Junio C Hamano103b5722011-01-31 05:03:451504<div class="paragraph"><p>The other nice thing with test suites, is that when you have one, you
Junio C Hamano2bd8a742009-12-01 21:16:591505already know how to test for bad behavior. So you can use this
1506knowledge to create a new test case for "git bisect" when it appears
1507that there is a regression. So it will be easier to bisect the bug and
1508fix it. And then you can add the test case you just created to your
1509test suite.</p></div>
Junio C Hamano103b5722011-01-31 05:03:451510<div class="paragraph"><p>So if you know how to create test cases and how to bisect, you will be
Junio C Hamano2bd8a742009-12-01 21:16:591511subject to a virtuous circle:</p></div>
Junio C Hamano103b5722011-01-31 05:03:451512<div class="paragraph"><p>more tests &#8658; easier to create tests &#8658; easier to bisect &#8658; more tests</p></div>
1513<div class="paragraph"><p>So test suites and "git bisect" are complementary tools that are very
Junio C Hamano2bd8a742009-12-01 21:16:591514powerful and efficient when used together.</p></div>
Junio C Hamano9d971152012-12-19 00:43:111515</div>
1516<div class="sect2">
1517<h3 id="_bisecting_build_failures">Bisecting build failures</h3>
Junio C Hamano103b5722011-01-31 05:03:451518<div class="paragraph"><p>You can very easily automatically bisect broken builds using something
Junio C Hamano2bd8a742009-12-01 21:16:591519like:</p></div>
1520<div class="listingblock">
1521<div class="content">
Junio C Hamano9d971152012-12-19 00:43:111522<pre><code>$ git bisect start BAD GOOD
1523$ git bisect run make</code></pre>
Junio C Hamano2bd8a742009-12-01 21:16:591524</div></div>
Junio C Hamano9d971152012-12-19 00:43:111525</div>
1526<div class="sect2">
1527<h3 id="_passing_sh_c_some_commands_to_git_bisect_run">Passing sh -c "some commands" to "git bisect run"</h3>
Junio C Hamano103b5722011-01-31 05:03:451528<div class="paragraph"><p>For example:</p></div>
Junio C Hamano2bd8a742009-12-01 21:16:591529<div class="listingblock">
1530<div class="content">
Junio C Hamano9d971152012-12-19 00:43:111531<pre><code>$ git bisect run sh -c "make || exit 125; ./my_app | grep 'good output'"</code></pre>
Junio C Hamano2bd8a742009-12-01 21:16:591532</div></div>
Junio C Hamano103b5722011-01-31 05:03:451533<div class="paragraph"><p>On the other hand if you do this often, then it can be worth having
Junio C Hamano2bd8a742009-12-01 21:16:591534scripts to avoid too much typing.</p></div>
Junio C Hamano9d971152012-12-19 00:43:111535</div>
1536<div class="sect2">
1537<h3 id="_finding_performance_regressions">Finding performance regressions</h3>
Junio C Hamano103b5722011-01-31 05:03:451538<div class="paragraph"><p>Here is an example script that comes slightly modified from a real
Junio C Hamano2bd8a742009-12-01 21:16:591539world script used by Junio Hamano <a href="#4">[4]</a>.</p></div>
Junio C Hamano103b5722011-01-31 05:03:451540<div class="paragraph"><p>This script can be passed to "git bisect run" to find the commit that
Junio C Hamano2bd8a742009-12-01 21:16:591541introduced a performance regression:</p></div>
1542<div class="listingblock">
1543<div class="content">
Junio C Hamano9d971152012-12-19 00:43:111544<pre><code>#!/bin/sh
Junio C Hamano2bd8a742009-12-01 21:16:591545
1546# Build errors are not what I am interested in.
1547make my_app || exit 255
1548
1549# We are checking if it stops in a reasonable amount of time, so
1550# let it run in the background...
1551
1552./my_app &gt;log 2&gt;&amp;1 &amp;
1553
1554# ... and grab its process ID.
1555pid=$!
1556
1557# ... and then wait for sufficiently long.
1558sleep $NORMAL_TIME
1559
1560# ... and then see if the process is still there.
1561if kill -0 $pid
1562then
1563 # It is still running -- that is bad.
1564 kill $pid; sleep 1; kill $pid;
1565 exit 1
1566else
1567 # It has already finished (the $pid process was no more),
1568 # and we are happy.
1569 exit 0
Junio C Hamano9d971152012-12-19 00:43:111570fi</code></pre>
Junio C Hamano2bd8a742009-12-01 21:16:591571</div></div>
Junio C Hamano9d971152012-12-19 00:43:111572</div>
1573<div class="sect2">
1574<h3 id="_following_general_best_practices">Following general best practices</h3>
Junio C Hamano103b5722011-01-31 05:03:451575<div class="paragraph"><p>It is obviously a good idea not to have commits with changes that
Junio C Hamano2bd8a742009-12-01 21:16:591576knowingly break things, even if some other commits later fix the
1577breakage.</p></div>
Junio C Hamano103b5722011-01-31 05:03:451578<div class="paragraph"><p>It is also a good idea when using any VCS to have only one small
Junio C Hamano2bd8a742009-12-01 21:16:591579logical change in each commit.</p></div>
Junio C Hamano103b5722011-01-31 05:03:451580<div class="paragraph"><p>The smaller the changes in your commit, the most effective "git
Junio C Hamano2bd8a742009-12-01 21:16:591581bisect" will be. And you will probably need "git bisect" less in the
1582first place, as small changes are easier to review even if they are
Junio C Hamano619596a2010-08-18 22:15:351583only reviewed by the committer.</p></div>
Junio C Hamano103b5722011-01-31 05:03:451584<div class="paragraph"><p>Another good idea is to have good commit messages. They can be very
Junio C Hamano2bd8a742009-12-01 21:16:591585helpful to understand why some changes were made.</p></div>
Junio C Hamano103b5722011-01-31 05:03:451586<div class="paragraph"><p>These general best practices are very helpful if you bisect often.</p></div>
Junio C Hamano9d971152012-12-19 00:43:111587</div>
1588<div class="sect2">
1589<h3 id="_avoiding_bug_prone_merges">Avoiding bug prone merges</h3>
Junio C Hamano103b5722011-01-31 05:03:451590<div class="paragraph"><p>First merges by themselves can introduce some regressions even when
Junio C Hamano2bd8a742009-12-01 21:16:591591the merge needs no source code conflict resolution. This is because a
1592semantic change can happen in one branch while the other branch is not
1593aware of it.</p></div>
Junio C Hamano103b5722011-01-31 05:03:451594<div class="paragraph"><p>For example one branch can change the semantic of a function while the
Junio C Hamano2bd8a742009-12-01 21:16:591595other branch add more calls to the same function.</p></div>
Junio C Hamano103b5722011-01-31 05:03:451596<div class="paragraph"><p>This is made much worse if many files have to be fixed to resolve
1597conflicts. That&#8217;s why such merges are called "evil merges". They can
Junio C Hamano2bd8a742009-12-01 21:16:591598make regressions very difficult to track down. It can even be
1599misleading to know the first bad commit if it happens to be such a
1600merge, because people might think that the bug comes from bad conflict
1601resolution when it comes from a semantic change in one branch.</p></div>
Junio C Hamano103b5722011-01-31 05:03:451602<div class="paragraph"><p>Anyway "git rebase" can be used to linearize history. This can be used
Junio C Hamano2bd8a742009-12-01 21:16:591603either to avoid merging in the first place. Or it can be used to
1604bisect on a linear history instead of the non linear one, as this
1605should give more information in case of a semantic change in one
1606branch.</p></div>
Junio C Hamano103b5722011-01-31 05:03:451607<div class="paragraph"><p>Merges can be also made simpler by using smaller branches or by using
Junio C Hamano2bd8a742009-12-01 21:16:591608many topic branches instead of only long version related branches.</p></div>
Junio C Hamano103b5722011-01-31 05:03:451609<div class="paragraph"><p>And testing can be done more often in special integration branches
Junio C Hamano2bd8a742009-12-01 21:16:591610like linux-next for the linux kernel.</p></div>
Junio C Hamano9d971152012-12-19 00:43:111611</div>
1612<div class="sect2">
1613<h3 id="_adapting_your_work_flow">Adapting your work-flow</h3>
Junio C Hamano103b5722011-01-31 05:03:451614<div class="paragraph"><p>A special work-flow to process regressions can give great results.</p></div>
1615<div class="paragraph"><p>Here is an example of a work-flow used by Andreas Ericsson:</p></div>
1616<div class="ulist"><ul>
Junio C Hamano2bd8a742009-12-01 21:16:591617<li>
1618<p>
1619write, in the test suite, a test script that exposes the regression
1620</p>
1621</li>
1622<li>
1623<p>
1624use "git bisect run" to find the commit that introduced it
1625</p>
1626</li>
1627<li>
1628<p>
1629fix the bug that is often made obvious by the previous step
1630</p>
1631</li>
1632<li>
1633<p>
1634commit both the fix and the test script (and if needed more tests)
1635</p>
1636</li>
1637</ul></div>
Junio C Hamano103b5722011-01-31 05:03:451638<div class="paragraph"><p>And here is what Andreas said about this work-flow <a href="#5">[5]</a>:</p></div>
Junio C Hamano2bd8a742009-12-01 21:16:591639<div class="quoteblock">
Junio C Hamano9d971152012-12-19 00:43:111640<div class="content">
Junio C Hamano103b5722011-01-31 05:03:451641<div class="paragraph"><p>To give some hard figures, we used to have an average report-to-fix
Junio C Hamano2bd8a742009-12-01 21:16:591642cycle of 142.6 hours (according to our somewhat weird bug-tracker
Junio C Hamano103b5722011-01-31 05:03:451643which just measures wall-clock time). Since we moved to git, we&#8217;ve
Junio C Hamano2bd8a742009-12-01 21:16:591644lowered that to 16.2 hours. Primarily because we can stay on top of
Junio C Hamano103b5722011-01-31 05:03:451645the bug fixing now, and because everyone&#8217;s jockeying to get to fix
1646bugs (we&#8217;re quite proud of how lazy we are to let git find the bugs
Junio C Hamano2bd8a742009-12-01 21:16:591647for us). Each new release results in ~40% fewer bugs (almost certainly
1648due to how we now feel about writing tests).</p></div>
Junio C Hamano103b5722011-01-31 05:03:451649</div>
Junio C Hamano9d971152012-12-19 00:43:111650<div class="attribution">
Junio C Hamano103b5722011-01-31 05:03:451651</div></div>
1652<div class="paragraph"><p>Clearly this work-flow uses the virtuous circle between test suites
Junio C Hamano2bd8a742009-12-01 21:16:591653and "git bisect". In fact it makes it the standard procedure to deal
1654with regression.</p></div>
Junio C Hamano103b5722011-01-31 05:03:451655<div class="paragraph"><p>In other messages Andreas says that they also use the "best practices"
Junio C Hamano2bd8a742009-12-01 21:16:591656described above: small logical commits, topic branches, no evil
1657merge,&#8230; These practices all improve the bisectability of the commit
1658graph, by making it easier and more useful to bisect.</p></div>
Junio C Hamano103b5722011-01-31 05:03:451659<div class="paragraph"><p>So a good work-flow should be designed around the above points. That
Junio C Hamano2bd8a742009-12-01 21:16:591660is making bisecting easier, more useful and standard.</p></div>
Junio C Hamano9d971152012-12-19 00:43:111661</div>
1662<div class="sect2">
1663<h3 id="_involving_qa_people_and_if_possible_end_users">Involving QA people and if possible end users</h3>
Junio C Hamano103b5722011-01-31 05:03:451664<div class="paragraph"><p>One nice about "git bisect" is that it is not only a developer
Junio C Hamano2bd8a742009-12-01 21:16:591665tool. It can effectively be used by QA people or even end users (if
1666they have access to the source code or if they can get access to all
1667the builds).</p></div>
Junio C Hamano103b5722011-01-31 05:03:451668<div class="paragraph"><p>There was a discussion at one point on the linux kernel mailing list
Junio C Hamano2bd8a742009-12-01 21:16:591669of whether it was ok to always ask end user to bisect, and very good
1670points were made to support the point of view that it is ok.</p></div>
Junio C Hamano103b5722011-01-31 05:03:451671<div class="paragraph"><p>For example David Miller wrote <a href="#6">[6]</a>:</p></div>
Junio C Hamano2bd8a742009-12-01 21:16:591672<div class="quoteblock">
Junio C Hamano9d971152012-12-19 00:43:111673<div class="content">
Junio C Hamano103b5722011-01-31 05:03:451674<div class="paragraph"><p>What people don&#8217;t get is that this is a situation where the "end node
Junio C Hamano2bd8a742009-12-01 21:16:591675principle" applies. When you have limited resources (here: developers)
Junio C Hamano103b5722011-01-31 05:03:451676you don&#8217;t push the bulk of the burden upon them. Instead you push
Junio C Hamano2bd8a742009-12-01 21:16:591677things out to the resource you have a lot of, the end nodes (here:
1678users), so that the situation actually scales.</p></div>
Junio C Hamano103b5722011-01-31 05:03:451679</div>
Junio C Hamano9d971152012-12-19 00:43:111680<div class="attribution">
Junio C Hamano103b5722011-01-31 05:03:451681</div></div>
1682<div class="paragraph"><p>This means that it is often "cheaper" if QA people or end users can do
Junio C Hamano2bd8a742009-12-01 21:16:591683it.</p></div>
Junio C Hamano103b5722011-01-31 05:03:451684<div class="paragraph"><p>What is interesting too is that end users that are reporting bugs (or
Junio C Hamano2bd8a742009-12-01 21:16:591685QA people that reproduced a bug) have access to the environment where
1686the bug happens. So they can often more easily reproduce a
1687regression. And if they can bisect, then more information will be
1688extracted from the environment where the bug happens, which means that
1689it will be easier to understand and then fix the bug.</p></div>
Junio C Hamano103b5722011-01-31 05:03:451690<div class="paragraph"><p>For open source projects it can be a good way to get more useful
Junio C Hamano2bd8a742009-12-01 21:16:591691contributions from end users, and to introduce them to QA and
1692development activities.</p></div>
Junio C Hamano9d971152012-12-19 00:43:111693</div>
1694<div class="sect2">
1695<h3 id="_using_complex_scripts">Using complex scripts</h3>
Junio C Hamano103b5722011-01-31 05:03:451696<div class="paragraph"><p>In some cases like for kernel development it can be worth developing
Junio C Hamano2bd8a742009-12-01 21:16:591697complex scripts to be able to fully automate bisecting.</p></div>
Junio C Hamano103b5722011-01-31 05:03:451698<div class="paragraph"><p>Here is what Ingo Molnar says about that <a href="#7">[7]</a>:</p></div>
Junio C Hamano2bd8a742009-12-01 21:16:591699<div class="quoteblock">
Junio C Hamano9d971152012-12-19 00:43:111700<div class="content">
Junio C Hamano103b5722011-01-31 05:03:451701<div class="paragraph"><p>i have a fully automated bootup-hang bisection script. It is based on
Junio C Hamano2bd8a742009-12-01 21:16:591702"git-bisect run". I run the script, it builds and boots kernels fully
1703automatically, and when the bootup fails (the script notices that via
1704the serial log, which it continuously watches - or via a timeout, if
Junio C Hamano103b5722011-01-31 05:03:451705the system does not come up within 10 minutes it&#8217;s a "bad" kernel),
Junio C Hamano2bd8a742009-12-01 21:16:591706the script raises my attention via a beep and i power cycle the test
1707box. (yeah, i should make use of a managed power outlet to 100%
1708automate it)</p></div>
Junio C Hamano103b5722011-01-31 05:03:451709</div>
Junio C Hamano9d971152012-12-19 00:43:111710<div class="attribution">
Junio C Hamano103b5722011-01-31 05:03:451711</div></div>
Junio C Hamano9d971152012-12-19 00:43:111712</div>
1713<div class="sect2">
1714<h3 id="_combining_test_suites_git_bisect_and_other_systems_together">Combining test suites, git bisect and other systems together</h3>
Junio C Hamano103b5722011-01-31 05:03:451715<div class="paragraph"><p>We have seen that test suites an git bisect are very powerful when
Junio C Hamano2bd8a742009-12-01 21:16:591716used together. It can be even more powerful if you can combine them
1717with other systems.</p></div>
Junio C Hamano103b5722011-01-31 05:03:451718<div class="paragraph"><p>For example some test suites could be run automatically at night with
Junio C Hamano2bd8a742009-12-01 21:16:591719some unusual (or even random) configurations. And if a regression is
1720found by a test suite, then "git bisect" can be automatically
1721launched, and its result can be emailed to the author of the first bad
1722commit found by "git bisect", and perhaps other people too. And a new
1723entry in the bug tracking system could be automatically created too.</p></div>
1724</div>
Junio C Hamano9d971152012-12-19 00:43:111725</div>
1726</div>
1727<div class="sect1">
Junio C Hamano2bd8a742009-12-01 21:16:591728<h2 id="_the_future_of_bisecting">The future of bisecting</h2>
1729<div class="sectionbody">
Junio C Hamano9d971152012-12-19 00:43:111730<div class="sect2">
1731<h3 id="_git_replace">"git replace"</h3>
Junio C Hamano103b5722011-01-31 05:03:451732<div class="paragraph"><p>We saw earlier that "git bisect skip" is now using a PRNG to try to
Junio C Hamano2bd8a742009-12-01 21:16:591733avoid areas in the commit graph where commits are untestable. The
1734problem is that sometimes the first bad commit will be in an
1735untestable area.</p></div>
Junio C Hamano103b5722011-01-31 05:03:451736<div class="paragraph"><p>To simplify the discussion we will suppose that the untestable area is
Junio C Hamano2bd8a742009-12-01 21:16:591737a simple string of commits and that it was created by a breakage
Junio C Hamano103b5722011-01-31 05:03:451738introduced by one commit (let&#8217;s call it BBC for bisect breaking
1739commit) and later fixed by another one (let&#8217;s call it BFC for bisect
Junio C Hamano2bd8a742009-12-01 21:16:591740fixing commit).</p></div>
Junio C Hamano103b5722011-01-31 05:03:451741<div class="paragraph"><p>For example:</p></div>
Junio C Hamano2bd8a742009-12-01 21:16:591742<div class="listingblock">
1743<div class="content">
Junio C Hamano9d971152012-12-19 00:43:111744<pre><code>...-Y-BBC-X1-X2-X3-X4-X5-X6-BFC-Z-...</code></pre>
Junio C Hamano2bd8a742009-12-01 21:16:591745</div></div>
Junio C Hamano103b5722011-01-31 05:03:451746<div class="paragraph"><p>where we know that Y is good and BFC is bad, and where BBC and X1 to
Junio C Hamano2bd8a742009-12-01 21:16:591747X6 are untestable.</p></div>
Junio C Hamano103b5722011-01-31 05:03:451748<div class="paragraph"><p>In this case if you are bisecting manually, what you can do is create
Junio C Hamano2bd8a742009-12-01 21:16:591749a special branch that starts just before the BBC. The first commit in
1750this branch should be the BBC with the BFC squashed into it. And the
1751other commits in the branch should be the commits between BBC and BFC
1752rebased on the first commit of the branch and then the commit after
1753BFC also rebased on.</p></div>
Junio C Hamano103b5722011-01-31 05:03:451754<div class="paragraph"><p>For example:</p></div>
Junio C Hamano2bd8a742009-12-01 21:16:591755<div class="listingblock">
1756<div class="content">
Junio C Hamano9d971152012-12-19 00:43:111757<pre><code> (BBC+BFC)-X1'-X2'-X3'-X4'-X5'-X6'-Z'
Junio C Hamano2bd8a742009-12-01 21:16:591758 /
Junio C Hamano9d971152012-12-19 00:43:111759...-Y-BBC-X1-X2-X3-X4-X5-X6-BFC-Z-...</code></pre>
Junio C Hamano2bd8a742009-12-01 21:16:591760</div></div>
Junio C Hamano103b5722011-01-31 05:03:451761<div class="paragraph"><p>where commits quoted with ' have been rebased.</p></div>
1762<div class="paragraph"><p>You can easily create such a branch with Git using interactive rebase.</p></div>
1763<div class="paragraph"><p>For example using:</p></div>
Junio C Hamano2bd8a742009-12-01 21:16:591764<div class="listingblock">
1765<div class="content">
Junio C Hamano9d971152012-12-19 00:43:111766<pre><code>$ git rebase -i Y Z</code></pre>
Junio C Hamano2bd8a742009-12-01 21:16:591767</div></div>
Junio C Hamano103b5722011-01-31 05:03:451768<div class="paragraph"><p>and then moving BFC after BBC and squashing it.</p></div>
1769<div class="paragraph"><p>After that you can start bisecting as usual in the new branch and you
Junio C Hamano2bd8a742009-12-01 21:16:591770should eventually find the first bad commit.</p></div>
Junio C Hamano103b5722011-01-31 05:03:451771<div class="paragraph"><p>For example:</p></div>
Junio C Hamano2bd8a742009-12-01 21:16:591772<div class="listingblock">
1773<div class="content">
Junio C Hamano9d971152012-12-19 00:43:111774<pre><code>$ git bisect start Z' Y</code></pre>
Junio C Hamano2bd8a742009-12-01 21:16:591775</div></div>
Junio C Hamano103b5722011-01-31 05:03:451776<div class="paragraph"><p>If you are using "git bisect run", you can use the same manual fix up
Junio C Hamano2bd8a742009-12-01 21:16:591777as above, and then start another "git bisect run" in the special
1778branch. Or as the "git bisect" man page says, the script passed to
1779"git bisect run" can apply a patch before it compiles and test the
1780software <a href="#8">[8]</a>. The patch should turn a current untestable commits
1781into a testable one. So the testing will result in "good" or "bad" and
1782"git bisect" will be able to find the first bad commit. And the script
1783should not forget to remove the patch once the testing is done before
1784exiting from the script.</p></div>
Junio C Hamano103b5722011-01-31 05:03:451785<div class="paragraph"><p>(Note that instead of a patch you can use "git cherry-pick BFC" to
1786apply the fix, and in this case you should use "git reset --hard
Junio C Hamano2bd8a742009-12-01 21:16:591787HEAD^" to revert the cherry-pick after testing and before returning
1788from the script.)</p></div>
Junio C Hamano103b5722011-01-31 05:03:451789<div class="paragraph"><p>But the above ways to work around untestable areas are a little bit
Junio C Hamano2bd8a742009-12-01 21:16:591790clunky. Using special branches is nice because these branches can be
1791shared by developers like usual branches, but the risk is that people
1792will get many such branches. And it disrupts the normal "git bisect"
1793work-flow. So, if you want to use "git bisect run" completely
1794automatically, you have to add special code in your script to restart
1795bisection in the special branches.</p></div>
Junio C Hamano103b5722011-01-31 05:03:451796<div class="paragraph"><p>Anyway one can notice in the above special branch example that the Z'
Junio C Hamano2bd8a742009-12-01 21:16:591797and Z commits should point to the same source code state (the same
Junio C Hamano103b5722011-01-31 05:03:451798"tree" in git parlance). That&#8217;s because Z' result from applying the
Junio C Hamano2bd8a742009-12-01 21:16:591799same changes as Z just in a slightly different order.</p></div>
Junio C Hamano103b5722011-01-31 05:03:451800<div class="paragraph"><p>So if we could just "replace" Z by Z' when we bisect, then we would
Junio C Hamano2bd8a742009-12-01 21:16:591801not need to add anything to a script. It would just work for anyone in
1802the project sharing the special branches and the replacements.</p></div>
Junio C Hamano103b5722011-01-31 05:03:451803<div class="paragraph"><p>With the example above that would give:</p></div>
Junio C Hamano2bd8a742009-12-01 21:16:591804<div class="listingblock">
1805<div class="content">
Junio C Hamano9d971152012-12-19 00:43:111806<pre><code> (BBC+BFC)-X1'-X2'-X3'-X4'-X5'-X6'-Z'-...
Junio C Hamano2bd8a742009-12-01 21:16:591807 /
Junio C Hamano9d971152012-12-19 00:43:111808...-Y-BBC-X1-X2-X3-X4-X5-X6-BFC-Z</code></pre>
Junio C Hamano2bd8a742009-12-01 21:16:591809</div></div>
Junio C Hamano103b5722011-01-31 05:03:451810<div class="paragraph"><p>That&#8217;s why the "git replace" command was created. Technically it
Junio C Hamano2bd8a742009-12-01 21:16:591811stores replacements "refs" in the "refs/replace/" hierarchy. These
1812"refs" are like branches (that are stored in "refs/heads/") or tags
1813(that are stored in "refs/tags"), and that means that they can
1814automatically be shared like branches or tags among developers.</p></div>
Junio C Hamano103b5722011-01-31 05:03:451815<div class="paragraph"><p>"git replace" is a very powerful mechanism. It can be used to fix
Junio C Hamano2bd8a742009-12-01 21:16:591816commits in already released history, for example to change the commit
1817message or the author. And it can also be used instead of git "grafts"
1818to link a repository with another old repository.</p></div>
Junio C Hamano103b5722011-01-31 05:03:451819<div class="paragraph"><p>In fact it&#8217;s this last feature that "sold" it to the git community, so
1820it is now in the "master" branch of git&#8217;s git repository and it should
Junio C Hamano2bd8a742009-12-01 21:16:591821be released in git 1.6.5 in October or November 2009.</p></div>
Junio C Hamano103b5722011-01-31 05:03:451822<div class="paragraph"><p>One problem with "git replace" is that currently it stores all the
Junio C Hamano2bd8a742009-12-01 21:16:591823replacements refs in "refs/replace/", but it would be perhaps better
1824if the replacement refs that are useful only for bisecting would be in
1825"refs/replace/bisect/". This way the replacement refs could be used
1826only for bisecting, while other refs directly in "refs/replace/" would
1827be used nearly all the time.</p></div>
Junio C Hamano9d971152012-12-19 00:43:111828</div>
1829<div class="sect2">
1830<h3 id="_bisecting_sporadic_bugs">Bisecting sporadic bugs</h3>
Junio C Hamano103b5722011-01-31 05:03:451831<div class="paragraph"><p>Another possible improvement to "git bisect" would be to optionally
Junio C Hamano2bd8a742009-12-01 21:16:591832add some redundancy to the tests performed so that it would be more
1833reliable when tracking sporadic bugs.</p></div>
Junio C Hamano103b5722011-01-31 05:03:451834<div class="paragraph"><p>This has been requested by some kernel developers because some bugs
Junio C Hamano2bd8a742009-12-01 21:16:591835called sporadic bugs do not appear in all the kernel builds because
1836they are very dependent on the compiler output.</p></div>
Junio C Hamano103b5722011-01-31 05:03:451837<div class="paragraph"><p>The idea is that every 3 test for example, "git bisect" could ask the
Junio C Hamano2bd8a742009-12-01 21:16:591838user to test a commit that has already been found to be "good" or
1839"bad" (because one of its descendants or one of its ancestors has been
1840found to be "good" or "bad" respectively). If it happens that a commit
1841has been previously incorrectly classified then the bisection can be
1842aborted early, hopefully before too many mistakes have been made. Then
1843the user will have to look at what happened and then restart the
1844bisection using a fixed bisect log.</p></div>
Junio C Hamano103b5722011-01-31 05:03:451845<div class="paragraph"><p>There is already a project called BBChop created by Ealdwulf Wuffinga
Junio C Hamano2bd8a742009-12-01 21:16:591846on Github that does something like that using Bayesian Search Theory
1847<a href="#9">[9]</a>:</p></div>
1848<div class="quoteblock">
Junio C Hamano9d971152012-12-19 00:43:111849<div class="content">
Junio C Hamano103b5722011-01-31 05:03:451850<div class="paragraph"><p>BBChop is like <em>git bisect</em> (or equivalent), but works when your bug
Junio C Hamano2bd8a742009-12-01 21:16:591851is intermittent. That is, it works in the presence of false negatives
1852(when a version happens to work this time even though it contains the
1853bug). It assumes that there are no false positives (in principle, the
1854same approach would work, but adding it may be non-trivial).</p></div>
Junio C Hamano103b5722011-01-31 05:03:451855</div>
Junio C Hamano9d971152012-12-19 00:43:111856<div class="attribution">
Junio C Hamano103b5722011-01-31 05:03:451857</div></div>
1858<div class="paragraph"><p>But BBChop is independent of any VCS and it would be easier for Git
Junio C Hamano2bd8a742009-12-01 21:16:591859users to have something integrated in Git.</p></div>
1860</div>
Junio C Hamano9d971152012-12-19 00:43:111861</div>
1862</div>
1863<div class="sect1">
Junio C Hamano2bd8a742009-12-01 21:16:591864<h2 id="_conclusion">Conclusion</h2>
1865<div class="sectionbody">
Junio C Hamano103b5722011-01-31 05:03:451866<div class="paragraph"><p>We have seen that regressions are an important problem, and that "git
Junio C Hamano2bd8a742009-12-01 21:16:591867bisect" has nice features that complement very well practices and
1868other tools, especially test suites, that are generally used to fight
1869regressions. But it might be needed to change some work-flows and
1870(bad) habits to get the most out of it.</p></div>
Junio C Hamano103b5722011-01-31 05:03:451871<div class="paragraph"><p>Some improvements to the algorithms inside "git bisect" are possible
Junio C Hamano2bd8a742009-12-01 21:16:591872and some new features could help in some cases, but overall "git
1873bisect" works already very well, is used a lot, and is already very
Junio C Hamano103b5722011-01-31 05:03:451874useful. To back up that last claim, let&#8217;s give the final word to Ingo
Junio C Hamano2bd8a742009-12-01 21:16:591875Molnar when he was asked by the author how much time does he think
1876"git bisect" saves him when he uses it:</p></div>
1877<div class="quoteblock">
Junio C Hamano9d971152012-12-19 00:43:111878<div class="content">
Junio C Hamano103b5722011-01-31 05:03:451879<div class="paragraph"><p>a <em>lot</em>.</p></div>
1880<div class="paragraph"><p>About ten years ago did i do my first <em>bisection</em> of a Linux patch
Junio C Hamano2bd8a742009-12-01 21:16:591881queue. That was prior the Git (and even prior the BitKeeper) days. I
1882literally days spent sorting out patches, creating what in essence
1883were standalone commits that i guessed to be related to that bug.</p></div>
Junio C Hamano103b5722011-01-31 05:03:451884<div class="paragraph"><p>It was a tool of absolute last resort. I&#8217;d rather spend days looking
Junio C Hamano2bd8a742009-12-01 21:16:591885at printk output than do a manual <em>patch bisection</em>.</p></div>
Junio C Hamano103b5722011-01-31 05:03:451886<div class="paragraph"><p>With Git bisect it&#8217;s a breeze: in the best case i can get a ~15 step
Junio C Hamano2bd8a742009-12-01 21:16:591887kernel bisection done in 20-30 minutes, in an automated way. Even with
Junio C Hamano103b5722011-01-31 05:03:451888manual help or when bisecting multiple, overlapping bugs, it&#8217;s rarely
Junio C Hamano2bd8a742009-12-01 21:16:591889more than an hour.</p></div>
Junio C Hamano103b5722011-01-31 05:03:451890<div class="paragraph"><p>In fact it&#8217;s invaluable because there are bugs i would never even
1891<em>try</em> to debug if it wasn&#8217;t for git bisect. In the past there were bug
Junio C Hamano2bd8a742009-12-01 21:16:591892patterns that were immediately hopeless for me to debug - at best i
1893could send the crash/bug signature to lkml and hope that someone else
1894can think of something.</p></div>
Junio C Hamano103b5722011-01-31 05:03:451895<div class="paragraph"><p>And even if a bisection fails today it tells us something valuable
1896about the bug: that it&#8217;s non-deterministic - timing or kernel image
Junio C Hamano2bd8a742009-12-01 21:16:591897layout dependent.</p></div>
Junio C Hamano103b5722011-01-31 05:03:451898<div class="paragraph"><p>So git bisect is unconditional goodness - and feel free to quote that
Junio C Hamano2bd8a742009-12-01 21:16:591899;-)</p></div>
Junio C Hamano103b5722011-01-31 05:03:451900</div>
Junio C Hamano9d971152012-12-19 00:43:111901<div class="attribution">
Junio C Hamano103b5722011-01-31 05:03:451902</div></div>
Junio C Hamano2bd8a742009-12-01 21:16:591903</div>
Junio C Hamano9d971152012-12-19 00:43:111904</div>
1905<div class="sect1">
Junio C Hamano2bd8a742009-12-01 21:16:591906<h2 id="_acknowledgements">Acknowledgements</h2>
1907<div class="sectionbody">
Junio C Hamano103b5722011-01-31 05:03:451908<div class="paragraph"><p>Many thanks to Junio Hamano for his help in reviewing this paper, for
Junio C Hamano2bd8a742009-12-01 21:16:591909reviewing the patches I sent to the git mailing list, for discussing
1910some ideas and helping me improve them, for improving "git bisect" a
1911lot and for his awesome work in maintaining and developing Git.</p></div>
Junio C Hamano103b5722011-01-31 05:03:451912<div class="paragraph"><p>Many thanks to Ingo Molnar for giving me very useful information that
Junio C Hamano2bd8a742009-12-01 21:16:591913appears in this paper, for commenting on this paper, for his
1914suggestions to improve "git bisect" and for evangelizing "git bisect"
1915on the linux kernel mailing lists.</p></div>
Junio C Hamano103b5722011-01-31 05:03:451916<div class="paragraph"><p>Many thanks to Linus Torvalds for inventing, developing and
Junio C Hamano2bd8a742009-12-01 21:16:591917evangelizing "git bisect", Git and Linux.</p></div>
Junio C Hamano103b5722011-01-31 05:03:451918<div class="paragraph"><p>Many thanks to the many other great people who helped one way or
Junio C Hamano2bd8a742009-12-01 21:16:591919another when I worked on git, especially to Andreas Ericsson, Johannes
1920Schindelin, H. Peter Anvin, Daniel Barkalow, Bill Lear, John Hawley,
1921Shawn O. Pierce, Jeff King, Sam Vilain, Jon Seymour.</p></div>
Junio C Hamano103b5722011-01-31 05:03:451922<div class="paragraph"><p>Many thanks to the Linux-Kongress program committee for choosing the
Junio C Hamano2bd8a742009-12-01 21:16:591923author to given a talk and for publishing this paper.</p></div>
1924</div>
Junio C Hamano9d971152012-12-19 00:43:111925</div>
1926<div class="sect1">
Junio C Hamano2bd8a742009-12-01 21:16:591927<h2 id="_references">References</h2>
1928<div class="sectionbody">
Junio C Hamano103b5722011-01-31 05:03:451929<div class="ulist"><ul>
Junio C Hamano2bd8a742009-12-01 21:16:591930<li>
1931<p>
1932<a id="1"></a>[1] <a href="http://www.nist.gov/public_affairs/releases/n02-10.htm"><em>Software Errors Cost U.S. Economy $59.5 Billion Annually</em>. Nist News Release.</a>
1933</p>
1934</li>
1935<li>
1936<p>
1937<a id="2"></a>[2] <a href="http://java.sun.com/docs/codeconv/html/CodeConventions.doc.html#16712"><em>Code Conventions for the Java Programming Language</em>. Sun Microsystems.</a>
1938</p>
1939</li>
1940<li>
1941<p>
1942<a id="3"></a>[3] <a href="http://en.wikipedia.org/wiki/Software_maintenance"><em>Software maintenance</em>. Wikipedia.</a>
1943</p>
1944</li>
1945<li>
1946<p>
1947<a id="4"></a>[4] <a href="http://article.gmane.org/gmane.comp.version-control.git/45195/">Junio C Hamano. <em>Automated bisect success story</em>. Gmane.</a>
1948</p>
1949</li>
1950<li>
1951<p>
1952<a id="5"></a>[5] <a href="http://lwn.net/Articles/317154/">Christian Couder. <em>Fully automated bisecting with "git bisect run"</em>. LWN.net.</a>
1953</p>
1954</li>
1955<li>
1956<p>
1957<a id="6"></a>[6] <a href="http://lwn.net/Articles/277872/">Jonathan Corbet. <em>Bisection divides users and developers</em>. LWN.net.</a>
1958</p>
1959</li>
1960<li>
1961<p>
Junio C Hamano103b5722011-01-31 05:03:451962<a id="7"></a>[7] <a href="http://article.gmane.org/gmane.linux.scsi/36652/">Ingo Molnar. <em>Re: BUG 2.6.23-rc3 can&#8217;t see sd partitions on Alpha</em>. Gmane.</a>
Junio C Hamano2bd8a742009-12-01 21:16:591963</p>
1964</li>
1965<li>
1966<p>
1967<a id="8"></a>[8] <a href="http://www.kernel.org/pub/software/scm/git/docs/git-bisect.html">Junio C Hamano and the git-list. <em>git-bisect(1) Manual Page</em>. Linux Kernel Archives.</a>
1968</p>
1969</li>
1970<li>
1971<p>
1972<a id="9"></a>[9] <a href="http://github.com/Ealdwulf/bbchop">Ealdwulf. <em>bbchop</em>. GitHub.</a>
1973</p>
1974</li>
1975</ul></div>
1976</div>
Junio C Hamano7bd050f2011-09-22 06:32:221977</div>
Junio C Hamano9d971152012-12-19 00:43:111978</div>
Junio C Hamano7bd050f2011-09-22 06:32:221979<div id="footnotes"><hr /></div>
Junio C Hamano2bd8a742009-12-01 21:16:591980<div id="footer">
1981<div id="footer-text">
Junio C Hamano9d971152012-12-19 00:43:111982Last updated 2012-11-20 13:06:02 PST
Junio C Hamano2bd8a742009-12-01 21:16:591983</div>
1984</div>
1985</body>
1986</html>