From: Christian Couder <chriscool@tuxfamily.org>
To: Junio C Hamano <gitster@pobox.com>,
Matthieu Moy <Matthieu.Moy@imag.fr>,
Pieter de Bie <pdebie@ai.rug.nl>,
Jakub Narebski <jnareb@gmail.com>,
Manoj Srivastava <srivasta@ieee.org>,
T
Cc: git@vger.kernel.org
Subject: [PATCH 2/2 v3] Documentation: bisect: add a few "git bisect run" examples
Date: Thu, 8 May 2008 01:00:54 +0200 [thread overview]
Message-ID: <20080508010054.e0c48934.chriscool@tuxfamily.org> (raw)
Before this patch, there were no "git bisect run" example.
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
---
Documentation/git-bisect.txt | 49 ++++++++++++++++++++++++++++++++++++++++++
1 files changed, 49 insertions(+), 0 deletions(-)
Changes since the previous version:
- add an example for a broken test suite
- use "cat" to show the content of "~/test.sh"
- tell that it's safer to have test scripts outside the repo
Thank you all for your comments.
diff --git a/Documentation/git-bisect.txt b/Documentation/git-bisect.txt
index 698ffde..539f37d 100644
--- a/Documentation/git-bisect.txt
+++ b/Documentation/git-bisect.txt
@@ -224,6 +224,55 @@ 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.
+EXAMPLES
+--------
+
+* Automatically bisect a broken build between v1.2 and HEAD:
++
+------------
+$ git bisect start HEAD v1.2 -- # HEAD is bad, v1.2 is good
+$ git bisect run make # "make" builds the app
+------------
+
+* Automatically bisect a broken test suite:
++
+------------
+$ 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
+------------
++
+Here we use a "test.sh" custom script. In this script, if "make"
+fails, we "skip" the current commit.
++
+It's safer to use a custom script outside the repo to prevent
+interactions between the bisect, make and test processes and the
+script.
++
+And "make test" should "exit 0", if the test suite passes, and
+"exit 1" (for example) otherwise.
+
+* Automatically bisect a broken test case:
++
+------------
+$ 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
+------------
++
+Here "check_test_case.sh" should "exit 0", if the test case passes,
+and "exit 1" (for example) otherwise.
++
+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.
+
Author
------
Written by Linus Torvalds <torvalds@osdl.org>
--
1.5.5.1.273.g4b50
reply other threads:[~2008-05-07 22:56 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20080508010054.e0c48934.chriscool@tuxfamily.org \
--to=chriscool@tuxfamily.org \
--cc=Matthieu.Moy@imag.fr \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=jnareb@gmail.com \
--cc=pdebie@ai.rug.nl \
--cc=srivasta@ieee.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).