{"thread":{"id":"18949","subject":"[PATCH 5/5] bisect: use \"git bisect--helper --next-exit\" in \"git-bisect.sh\"","startedAt":"2009-04-19T09:56:16Z","lastAt":"2009-04-19T09:56:16Z","messageCount":1,"participants":["Christian Couder"],"isPatch":true,"patchVersion":1,"patchTotal":5},"messages":[{"id":"111639","messageId":"20090419115616.3f4f6762.chriscool@tuxfamily.org","threadId":"18949","inReplyTo":null,"subject":"[PATCH 5/5] bisect: use \"git bisect--helper --next-exit\" in \"git-bisect.sh\"","fromName":"Christian Couder","fromEmail":"chriscool@tuxfamily.org","sentAt":"2009-04-19T09:56:16Z","receivedAt":"2009-04-19T09:56:16Z","isPatch":true,"sender":{"key":"christian.couder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/208954?v=4"},"body":"instead of \"git bisect--helper --next-vars\".\n\nSigned-off-by: Christian Couder <chriscool@tuxfamily.org>\n---\n git-bisect.sh |   39 +++++++++------------------------------\n 1 files changed, 9 insertions(+), 30 deletions(-)\n\ndiff --git a/git-bisect.sh b/git-bisect.sh\nindex 24712ff..e1f300b 100755\n--- a/git-bisect.sh\n+++ b/git-bisect.sh\n@@ -279,19 +279,6 @@ bisect_auto_next() {\n \tbisect_next_check && bisect_next || :\n }\n \n-exit_if_skipped_commits () {\n-\t_tried=$1\n-\t_bad=$2\n-\tif test -n \"$_tried\" ; then\n-\t\techo \"There are only 'skip'ped commit left to test.\"\n-\t\techo \"The first bad commit could be any of:\"\n-\t\techo \"$_tried\" | tr '[|]' '[\\012]'\n-\t\ttest -n \"$_bad\" && echo \"$_bad\"\n-\t\techo \"We cannot bisect more!\"\n-\t\texit 2\n-\tfi\n-}\n-\n bisect_checkout() {\n \t_rev=\"$1\"\n \t_msg=\"$2\"\n@@ -416,25 +403,17 @@ bisect_next() {\n \t# Return now if a checkout has already been done\n \ttest \"$?\" -eq \"1\" && return\n \n-\t# Get bisection information\n-\teval=$(eval \"git bisect--helper --next-vars\") &&\n-\teval \"$eval\" || exit\n+\t# Perform bisection computation, display and checkout\n+\tgit bisect--helper --next-exit\n+\tres=$?\n \n-\tif [ -z \"$bisect_rev\" ]; then\n-\t\t# We should exit here only if the \"bad\"\n-\t\t# commit is also a \"skip\" commit (see above).\n-\t\texit_if_skipped_commits \"$bisect_tried\"\n-\t\techo \"$bad was both good and bad\"\n-\t\texit 1\n-\tfi\n-\tif [ \"$bisect_rev\" = \"$bad\" ]; then\n-\t\texit_if_skipped_commits \"$bisect_tried\" \"$bad\"\n-\t\techo \"$bisect_rev is first bad commit\"\n-\t\tgit diff-tree --pretty $bisect_rev\n-\t\texit 0\n-\tfi\n+        # Check if we should exit because bisection is finished\n+\ttest $res -eq 10 && exit 0\n \n-\tbisect_checkout \"$bisect_rev\" \"$bisect_nr revisions left to test after this (roughly $bisect_steps steps)\"\n+\t# Check for an error in the bisection process\n+\ttest $res -ne 0 && exit $res\n+\n+\treturn 0\n }\n \n bisect_visualize() {\n-- \n1.6.2.2.537.g3b83b\n"}]}