git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 2/2] Documentation: bisect: add a few "git bisect run" examples

From
Christian Couder <chriscool@tuxfamily.org>
Date
May 7, 2008, 04:29 UTC
Message-ID
<20080507062931.dd72d7e1.chriscool@tuxfamily.org>
Before this patch, there were no proper "git bisect run" example.
---
 Documentation/git-bisect.txt |   26 ++++++++++++++++++++++++++
 1 files changed, 26 insertions(+), 0 deletions(-)
diff --git a/Documentation/git-bisect.txt b/Documentation/git-bisect.txt
index 698ffde..a05963a 100644
--- a/Documentation/git-bisect.txt
+++ b/Documentation/git-bisect.txt
@@ -224,6 +224,32 @@ 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 case using a custom script:
++
+------------
+echo "#"\!"/bin/sh" > ~/test.sh
+echo "make install || exit 125" >> ~/test.sh
+echo "~/check_test_case.sh" >> ~/test.sh
+chmod u+x ~/test.sh
+$ git bisect start v1.3 v1.1 --      # v1.3 is bad, v1.1 is good
+$ git bisect run ~/test.sh
+------------
++
+Here we first create the "test.sh" custom script. In this script, if
+"make install" fails, we "skip" the current commit.
+And "check_test_case.sh" should "exit 0", if the test case passes, and
+"exit 1" (for example) otherwise.
+
 Author
 ------
 Written by Linus Torvalds <torvalds@osdl.org>
-- 
1.5.5.1.126.g9ca01
Next: Junio C Hamano
Message 1 of 6 in “Documentation: bisect: add a few "git bisect run" examples”
  1. 2/2 Documentation: bisect: add a few "git bisect run" examplesChristian Couder, May 7, 2008
  2. Junio C HamanoMay 7, 2008
  3. Matthieu MoyMay 7, 2008
  4. Miklos VajnaMay 7, 2008
  5. Christian CouderMay 7, 2008
  6. Jon LoeligerMay 7, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.