git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] bisect: fix exiting when checkout failed in bisect_start()
@ 2011-09-21  5:17 Christian Couder
  2011-09-21  6:42 ` Jon Seymour
  0 siblings, 1 reply; 2+ messages in thread
From: Christian Couder @ 2011-09-21  5:17 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git, Joel Kaasinen, Jon Seymour

Commit 4796e823 ("bisect: introduce --no-checkout support into porcelain." Aug 4 2011)
made checking out the branch where we started depends on the "checkout" mode. But
unfortunately it lost the "|| exit" part after the checkout command.

As it makes no sense to continue if the checkout failed and as people have already
complained that the error message given when we just exit in this case is not clear, see:

http://thread.gmane.org/gmane.comp.version-control.git/180733/

this patch adds a "|| die <hopefully clear message>" part after the checkout command.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
---
 git-bisect.sh |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/git-bisect.sh b/git-bisect.sh
index e0ca3fb..5fb4291 100755
--- a/git-bisect.sh
+++ b/git-bisect.sh
@@ -129,7 +129,8 @@ bisect_start() {
 		start_head=$(cat "$GIT_DIR/BISECT_START")
 		if test "z$mode" != "z--no-checkout"
 		then
-			git checkout "$start_head" --
+			git checkout "$start_head" -- ||
+			die "$(eval_gettext "Checking out '\$start_head' failed. Try 'git bisect reset <validbranch>'.")"
 		fi
 	else
 		# Get rev from where we start.
-- 
1.7.7.rc0.72.g4b5ea.dirty

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] bisect: fix exiting when checkout failed in bisect_start()
  2011-09-21  5:17 [PATCH] bisect: fix exiting when checkout failed in bisect_start() Christian Couder
@ 2011-09-21  6:42 ` Jon Seymour
  0 siblings, 0 replies; 2+ messages in thread
From: Jon Seymour @ 2011-09-21  6:42 UTC (permalink / raw)
  To: Christian Couder; +Cc: Junio C Hamano, git, Joel Kaasinen

On Wed, Sep 21, 2011 at 3:17 PM, Christian Couder
<chriscool@tuxfamily.org> wrote:
> Commit 4796e823 ("bisect: introduce --no-checkout support into porcelain." Aug 4 2011)
> made checking out the branch where we started depends on the "checkout" mode. But
> unfortunately it lost the "|| exit" part after the checkout command.
>
> As it makes no sense to continue if the checkout failed and as people have already
> complained that the error message given when we just exit in this case is not clear, see:
>
> http://thread.gmane.org/gmane.comp.version-control.git/180733/
>
> this patch adds a "|| die <hopefully clear message>" part after the checkout command.
>
> Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
> ---
>  git-bisect.sh |    3 ++-
>  1 files changed, 2 insertions(+), 1 deletions(-)
>
> diff --git a/git-bisect.sh b/git-bisect.sh
> index e0ca3fb..5fb4291 100755
> --- a/git-bisect.sh
> +++ b/git-bisect.sh
> @@ -129,7 +129,8 @@ bisect_start() {
>                start_head=$(cat "$GIT_DIR/BISECT_START")
>                if test "z$mode" != "z--no-checkout"
>                then
> -                       git checkout "$start_head" --
> +                       git checkout "$start_head" -- ||
> +                       die "$(eval_gettext "Checking out '\$start_head' failed. Try 'git bisect reset <validbranch>'.")"
>                fi
>        else
>                # Get rev from where we start.
> --
> 1.7.7.rc0.72.g4b5ea.dirty
>
>

Thanks. Looks good to me.

Acked-by: Jon Seymour <jon.seymour@gmal.com>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-09-21  6:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-09-21  5:17 [PATCH] bisect: fix exiting when checkout failed in bisect_start() Christian Couder
2011-09-21  6:42 ` Jon Seymour

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).