{"thread":{"id":"13406","subject":"[PATCH 2/2] Documentation: bisect: add a few \"git bisect run\" examples","startedAt":"2008-05-07T04:29:31Z","lastAt":"2008-05-07T22:18:39Z","messageCount":6,"participants":["Christian Couder","Junio C Hamano","Matthieu Moy","Miklos Vajna","Jon Loeliger"],"isPatch":true,"patchVersion":1,"patchTotal":2},"messages":[{"id":"76245","messageId":"20080507062931.dd72d7e1.chriscool@tuxfamily.org","threadId":"13406","inReplyTo":null,"subject":"[PATCH 2/2] Documentation: bisect: add a few \"git bisect run\" examples","fromName":"Christian Couder","fromEmail":"chriscool@tuxfamily.org","sentAt":"2008-05-07T04:29:31Z","receivedAt":"2008-05-07T04:29:31Z","isPatch":true,"sender":{"key":"christian.couder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/208954?v=4"},"body":"Before this patch, there were no proper \"git bisect run\" example.\n---\n Documentation/git-bisect.txt |   26 ++++++++++++++++++++++++++\n 1 files changed, 26 insertions(+), 0 deletions(-)\n\ndiff --git a/Documentation/git-bisect.txt b/Documentation/git-bisect.txt\nindex 698ffde..a05963a 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 install || 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 install\" 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"},{"id":"76247","messageId":"7vwsm6g14i.fsf@gitster.siamese.dyndns.org","threadId":"13406","inReplyTo":"20080507062931.dd72d7e1.chriscool@tuxfamily.org","subject":"Re: [PATCH 2/2] Documentation: bisect: add a few \"git bisect run\" examples","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-05-07T04:59:57Z","receivedAt":"2008-05-07T04:59:57Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Christian Couder <chriscool@tuxfamily.org> writes:\n\n> Before this patch, there were no proper \"git bisect run\" example.\n\nAs if there were improper examples, and as if this patch adds a proper\none.  Drop \"proper\" and add sign-off perhaps?  ;-)\n\n> ---\n>  Documentation/git-bisect.txt |   26 ++++++++++++++++++++++++++\n>  1 files changed, 26 insertions(+), 0 deletions(-)\n>\n> diff --git a/Documentation/git-bisect.txt b/Documentation/git-bisect.txt\n> index 698ffde..a05963a 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 test case using a custom script:\n> ++\n> +------------\n> +echo \"#\"\\!\"/bin/sh\" > ~/test.sh\n> +echo \"make install || exit 125\" >> ~/test.sh\n> +echo \"~/check_test_case.sh\" >> ~/test.sh\n> +chmod u+x ~/test.sh\n\ns/install//; let's not set a bad example of installing first and then\ntesting.\n"},{"id":"76251","messageId":"vpqlk2mbpao.fsf@bauges.imag.fr","threadId":"13406","inReplyTo":"7vwsm6g14i.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH 2/2] Documentation: bisect: add a few \"git bisect run\" examples","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@imag.fr","sentAt":"2008-05-07T06:29:03Z","receivedAt":"2008-05-07T06:29:03Z","isPatch":true,"sender":{"key":"git@matthieu-moy.fr","avatar":"https://avatars.githubusercontent.com/u/14709?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n>> +------------\n>> +echo \"#\"\\!\"/bin/sh\" > ~/test.sh\n>> +echo \"make install || exit 125\" >> ~/test.sh\n>> +echo \"~/check_test_case.sh\" >> ~/test.sh\n>> +chmod u+x ~/test.sh\n>\n> s/install//; let's not set a bad example of installing first and then\n> testing.\n\nPerhaps also s/~/./g, since it's not a good idea to put temporary\nfiles in $HOME IMHO.\n\nAlso, using simple quotes instead of double would simplify the\n\"#\"\\!\"/bin/sh\".\n\n-- \nMatthieu\n"},{"id":"76253","messageId":"20080507072536.GJ23672@genesis.frugalware.org","threadId":"13406","inReplyTo":"vpqlk2mbpao.fsf@bauges.imag.fr","subject":"Re: [PATCH 2/2] Documentation: bisect: add a few \"git bisect run\" examples","fromName":"Miklos Vajna","fromEmail":"vmiklos@frugalware.org","sentAt":"2008-05-07T07:25:36Z","receivedAt":"2008-05-07T07:25:36Z","isPatch":true,"sender":{"key":"vmiklos@frugalware.org","avatar":"https://gravatar.com/avatar/401c1cbbb3a5d13e650c691a2c71d6fd0b80df1a01bc74d9f1972675dd58f2bd?d=mp&s=160"},"body":"On Wed, May 07, 2008 at 08:29:03AM +0200, Matthieu Moy <Matthieu.Moy@imag.fr> wrote:\n> Perhaps also s/~/./g, since it's not a good idea to put temporary\n> files in $HOME IMHO.\n\nthe point is to have it outside the repo. at least i regularly have 'git\nclean -f -x -d' in such a script if i don't trust the upstream build\nsystem. ;)\n"},{"id":"76302","messageId":"1210176560.6102.9.camel@ld0161-tx32","threadId":"13406","inReplyTo":"vpqlk2mbpao.fsf@bauges.imag.fr","subject":"Re: [PATCH 2/2] Documentation: bisect: add a few \"git bisect run\" examples","fromName":"Jon Loeliger","fromEmail":"jdl@freescale.com","sentAt":"2008-05-07T16:09:20Z","receivedAt":"2008-05-07T16:09:20Z","isPatch":true,"sender":{"key":"jdl@jdl.com","avatar":"https://gravatar.com/avatar/75ce9a10b151acd2c28ec4ab2136dba7b2ff1634530bd04b155981a749d08a64?d=mp&s=160"},"body":"On Wed, 2008-05-07 at 08:29 +0200, Matthieu Moy wrote:\n> Junio C Hamano <gitster@pobox.com> writes:\n> \n> >> +------------\n> >> +echo \"#\"\\!\"/bin/sh\" > ~/test.sh\n> >> +echo \"make install || exit 125\" >> ~/test.sh\n> >> +echo \"~/check_test_case.sh\" >> ~/test.sh\n> >> +chmod u+x ~/test.sh\n> >\n> > s/install//; let's not set a bad example of installing first and then\n> > testing.\n> \n> Perhaps also s/~/./g, since it's not a good idea to put temporary\n> files in $HOME IMHO.\n> \n> Also, using simple quotes instead of double would simplify the\n> \"#\"\\!\"/bin/sh\".\n\nHmm.  I would have just done \"$ cat ~/test.sh\" and\nthen shown the file listing directly.\n\njdl\n"},{"id":"76326","messageId":"200805080018.40181.chriscool@tuxfamily.org","threadId":"13406","inReplyTo":"20080507072536.GJ23672@genesis.frugalware.org","subject":"Re: [PATCH 2/2] Documentation: bisect: add a few \"git bisect run\" examples","fromName":"Christian Couder","fromEmail":"chriscool@tuxfamily.org","sentAt":"2008-05-07T22:18:39Z","receivedAt":"2008-05-07T22:18:39Z","isPatch":true,"sender":{"key":"christian.couder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/208954?v=4"},"body":"Le mercredi 7 mai 2008, Miklos Vajna a écrit :\n> On Wed, May 07, 2008 at 08:29:03AM +0200, Matthieu Moy \n<Matthieu.Moy@imag.fr> wrote:\n> > Perhaps also s/~/./g, since it's not a good idea to put temporary\n> > files in $HOME IMHO.\n>\n> the point is to have it outside the repo. \n\nYes. Especially, if the test case is a new one, the scripts that are used \nmust not have been checked in. Otherwise when bisect will checkout older \nversions, the scripts will be removed.\n\n> at least i regularly have 'git \n> clean -f -x -d' in such a script if i don't trust the upstream build\n> system. ;)\n"}]}