{"thread":{"id":"28454","subject":"[PATCH] bisect: fix exiting when checkout failed in bisect_start()","startedAt":"2011-09-21T05:17:24Z","lastAt":"2011-09-21T06:42:23Z","messageCount":2,"participants":["Christian Couder","Jon Seymour"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"175916","messageId":"20110921051725.5255.6756.chriscool@tuxfamily.org","threadId":"28454","inReplyTo":null,"subject":"[PATCH] bisect: fix exiting when checkout failed in bisect_start()","fromName":"Christian Couder","fromEmail":"chriscool@tuxfamily.org","sentAt":"2011-09-21T05:17:24Z","receivedAt":"2011-09-21T05:17:24Z","isPatch":true,"sender":{"key":"christian.couder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/208954?v=4"},"body":"Commit 4796e823 (\"bisect: introduce --no-checkout support into porcelain.\" Aug 4 2011)\nmade checking out the branch where we started depends on the \"checkout\" mode. But\nunfortunately it lost the \"|| exit\" part after the checkout command.\n\nAs it makes no sense to continue if the checkout failed and as people have already\ncomplained that the error message given when we just exit in this case is not clear, see:\n\nhttp://thread.gmane.org/gmane.comp.version-control.git/180733/\n\nthis patch adds a \"|| die <hopefully clear message>\" part after the checkout command.\n\nSigned-off-by: Christian Couder <chriscool@tuxfamily.org>\n---\n git-bisect.sh |    3 ++-\n 1 files changed, 2 insertions(+), 1 deletions(-)\n\ndiff --git a/git-bisect.sh b/git-bisect.sh\nindex e0ca3fb..5fb4291 100755\n--- a/git-bisect.sh\n+++ b/git-bisect.sh\n@@ -129,7 +129,8 @@ bisect_start() {\n \t\tstart_head=$(cat \"$GIT_DIR/BISECT_START\")\n \t\tif test \"z$mode\" != \"z--no-checkout\"\n \t\tthen\n-\t\t\tgit checkout \"$start_head\" --\n+\t\t\tgit checkout \"$start_head\" -- ||\n+\t\t\tdie \"$(eval_gettext \"Checking out '\\$start_head' failed. Try 'git bisect reset <validbranch>'.\")\"\n \t\tfi\n \telse\n \t\t# Get rev from where we start.\n-- \n1.7.7.rc0.72.g4b5ea.dirty\n"},{"id":"175919","messageId":"CAH3Anrpvz5mv+B2Y95rPytTUynELo63nZOdCc9CvYVhkvxvPgg@mail.gmail.com","threadId":"28454","inReplyTo":"20110921051725.5255.6756.chriscool@tuxfamily.org","subject":"Re: [PATCH] bisect: fix exiting when checkout failed in bisect_start()","fromName":"Jon Seymour","fromEmail":"jon.seymour@gmail.com","sentAt":"2011-09-21T06:42:23Z","receivedAt":"2011-09-21T06:42:23Z","isPatch":true,"sender":{"key":"jon.seymour@gmail.com","avatar":"https://avatars.githubusercontent.com/u/207131?v=4"},"body":"On Wed, Sep 21, 2011 at 3:17 PM, Christian Couder\n<chriscool@tuxfamily.org> wrote:\n> Commit 4796e823 (\"bisect: introduce --no-checkout support into porcelain.\" Aug 4 2011)\n> made checking out the branch where we started depends on the \"checkout\" mode. But\n> unfortunately it lost the \"|| exit\" part after the checkout command.\n>\n> As it makes no sense to continue if the checkout failed and as people have already\n> complained that the error message given when we just exit in this case is not clear, see:\n>\n> http://thread.gmane.org/gmane.comp.version-control.git/180733/\n>\n> this patch adds a \"|| die <hopefully clear message>\" part after the checkout command.\n>\n> Signed-off-by: Christian Couder <chriscool@tuxfamily.org>\n> ---\n>  git-bisect.sh |    3 ++-\n>  1 files changed, 2 insertions(+), 1 deletions(-)\n>\n> diff --git a/git-bisect.sh b/git-bisect.sh\n> index e0ca3fb..5fb4291 100755\n> --- a/git-bisect.sh\n> +++ b/git-bisect.sh\n> @@ -129,7 +129,8 @@ bisect_start() {\n>                start_head=$(cat \"$GIT_DIR/BISECT_START\")\n>                if test \"z$mode\" != \"z--no-checkout\"\n>                then\n> -                       git checkout \"$start_head\" --\n> +                       git checkout \"$start_head\" -- ||\n> +                       die \"$(eval_gettext \"Checking out '\\$start_head' failed. Try 'git bisect reset <validbranch>'.\")\"\n>                fi\n>        else\n>                # Get rev from where we start.\n> --\n> 1.7.7.rc0.72.g4b5ea.dirty\n>\n>\n\nThanks. Looks good to me.\n\nAcked-by: Jon Seymour <jon.seymour@gmal.com>\n"}]}