{"thread":{"id":"13408","subject":"[PATCH 2/2 amend] Documentation: bisect: add a few \"git bisect run\" examples","startedAt":"2008-05-07T05:34:30Z","lastAt":"2008-05-07T05:34:30Z","messageCount":1,"participants":["Christian Couder"],"isPatch":true,"patchVersion":1,"patchTotal":2},"messages":[{"id":"76249","messageId":"20080507073430.14ab87c3.chriscool@tuxfamily.org","threadId":"13408","inReplyTo":null,"subject":"[PATCH 2/2 amend] Documentation: bisect: add a few \"git bisect run\" examples","fromName":"Christian Couder","fromEmail":"chriscool@tuxfamily.org","sentAt":"2008-05-07T05:34:30Z","receivedAt":"2008-05-07T05:34:30Z","isPatch":true,"sender":{"key":"christian.couder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/208954?v=4"},"body":"Before this patch, there were no \"git bisect run\" example.\n\nSigned-off-by: Christian Couder <chriscool@tuxfamily.org>\n---\n Documentation/git-bisect.txt |   26 ++++++++++++++++++++++++++\n 1 files changed, 26 insertions(+), 0 deletions(-)\n\n\tJunio wrote:\n\t> As if there were improper examples, and as if this patch adds a proper\n\t> one.  Drop \"proper\" and add sign-off perhaps?  ;-)\n\n\t> s/install//; let's not set a bad example of installing first and then\n\t> testing.\n\n\tAll the above should be fixed in this amended patch.\n\tThanks.\n\ndiff --git a/Documentation/git-bisect.txt b/Documentation/git-bisect.txt\nindex 698ffde..f9b564c 100644\n--- a/Documentation/git-bisect.txt\n+++ b/Documentation/git-bisect.txt\n@@ -224,6 +224,32 @@ tree to the pristine state.  Finally the \"run\" script can exit with\n the status of the real test to let \"git bisect run\" command loop to\n know the outcome.\n \n+EXAMPLES\n+--------\n+\n+* Automatically bisect a broken build between v1.2 and HEAD:\n++\n+------------\n+$ git bisect start HEAD v1.2 --      # HEAD is bad, v1.2 is good\n+$ git bisect run make                # \"make\" builds the app\n+------------\n+\n+* Automatically bisect a broken test case using a custom script:\n++\n+------------\n+echo \"#\"\\!\"/bin/sh\" > ~/test.sh\n+echo \"make || exit 125\" >> ~/test.sh\n+echo \"~/check_test_case.sh\" >> ~/test.sh\n+chmod u+x ~/test.sh\n+$ git bisect start v1.3 v1.1 --      # v1.3 is bad, v1.1 is good\n+$ git bisect run ~/test.sh\n+------------\n++\n+Here we first create the \"test.sh\" custom script. In this script, if\n+\"make\" fails, we \"skip\" the current commit.\n+And \"check_test_case.sh\" should \"exit 0\", if the test case passes, and\n+\"exit 1\" (for example) otherwise.\n+\n Author\n ------\n Written by Linus Torvalds <torvalds@osdl.org>\n-- \n1.5.5.1.126.g9ca01\n"}]}