summaryrefslogtreecommitdiffstats
path: root/git-bisect.html
diff options
context:
space:
mode:
authorJunio C Hamano <junio@hera.kernel.org>2008-05-09 05:46:08 +0000
committerJunio C Hamano <junio@hera.kernel.org>2008-05-09 05:46:08 +0000
commit6d76d61fb621d158ee26238e735e282e33fb1a81 (patch)
treeedcabf096615344f6d597c38b9faf68b26ba024d /git-bisect.html
parent47d68a53947d51de4f67b6b7e4e7f76e71e16fb5 (diff)
downloadgit-htmldocs-6d76d61fb621d158ee26238e735e282e33fb1a81.tar.gz
Autogenerated HTML docs for v1.5.5.1-178-g1f81
Diffstat (limited to 'git-bisect.html')
-rw-r--r--git-bisect.html57
1 files changed, 56 insertions, 1 deletions
diff --git a/git-bisect.html b/git-bisect.html
index 438979162..c30b190f4 100644
--- a/git-bisect.html
+++ b/git-bisect.html
@@ -443,6 +443,61 @@ tree to the pristine state. Finally the "run" script can exit with
the status of the real test to let "git bisect run" command loop to
know the outcome.</p>
</div>
+<h2>EXAMPLES</h2>
+<div class="sectionbody">
+<ul>
+<li>
+<p>
+Automatically bisect a broken build between v1.2 and HEAD:
+</p>
+<div class="listingblock">
+<div class="content">
+<pre><tt>$ git bisect start HEAD v1.2 -- # HEAD is bad, v1.2 is good
+$ git bisect run make # "make" builds the app</tt></pre>
+</div></div>
+</li>
+<li>
+<p>
+Automatically bisect a broken test suite:
+</p>
+<div class="listingblock">
+<div class="content">
+<pre><tt>$ cat ~/test.sh
+#!/bin/sh
+make || exit 125 # this "skip"s broken builds
+make test # "make test" runs the test suite
+$ git bisect start v1.3 v1.1 -- # v1.3 is bad, v1.1 is good
+$ git bisect run ~/test.sh</tt></pre>
+</div></div>
+<p>Here we use a "test.sh" custom script. In this script, if "make"
+fails, we "skip" the current commit.</p>
+<p>It's safer to use a custom script outside the repo to prevent
+interactions between the bisect, make and test processes and the
+script.</p>
+<p>And "make test" should "exit 0", if the test suite passes, and
+"exit 1" (for example) otherwise.</p>
+</li>
+<li>
+<p>
+Automatically bisect a broken test case:
+</p>
+<div class="listingblock">
+<div class="content">
+<pre><tt>$ cat ~/test.sh
+#!/bin/sh
+make || exit 125 # this "skip"s broken builds
+~/check_test_case.sh # does the test case passes ?
+$ git bisect start HEAD HEAD~10 -- # culprit is among the last 10
+$ git bisect run ~/test.sh</tt></pre>
+</div></div>
+<p>Here "check_test_case.sh" should "exit 0", if the test case passes,
+and "exit 1" (for example) otherwise.</p>
+<p>It's safer if both "test.sh" and "check_test_case.sh" scripts are
+outside the repo to prevent interactions between the bisect, make and
+test processes and the scripts.</p>
+</li>
+</ul>
+</div>
<h2>Author</h2>
<div class="sectionbody">
<p>Written by Linus Torvalds &lt;torvalds@osdl.org&gt;</p>
@@ -457,7 +512,7 @@ know the outcome.</p>
</div>
<div id="footer">
<div id="footer-text">
-Last updated 12-Apr-2008 08:22:49 UTC
+Last updated 09-May-2008 05:45:35 UTC
</div>
</div>
</body>