git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Jon Seymour <jon.seymour@gmail.com>
Cc: git@vger.kernel.org, gitster@pobox.com
Subject: Re: [PATCH 0/2] bisect: cleanup formatting of git-bisect.sh
Date: Fri, 05 Aug 2011 10:09:23 -0700	[thread overview]
Message-ID: <7vsjpf3hvg.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <1312543891-11079-1-git-send-email-jon.seymour@gmail.com> (Jon Seymour's message of "Fri, 5 Aug 2011 21:31:29 +1000")

Jon Seymour <jon.seymour@gmail.com> writes:

> This series is intended to be applied on top js/bisect-no-checkout.

Thanks; I wonder if we want to go a bit further.

-- >8 --
Subject: bisect: further style nitpicks

Fix a few remaining lines that indented with spaces.

Also simplify the logic of checking out the original branch and reporting
error during "bisect reset".

Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 git-bisect.sh |   18 ++++++++----------
 1 files changed, 8 insertions(+), 10 deletions(-)

diff --git a/git-bisect.sh b/git-bisect.sh
index 1f3c46d..22c4da5 100755
--- a/git-bisect.sh
+++ b/git-bisect.sh
@@ -94,9 +94,9 @@ bisect_start() {
 			die "$(eval_gettext "unrecognised option: '\$arg'")" ;;
 		*)
 			rev=$(git rev-parse -q --verify "$arg^{commit}") || {
-			    test $has_double_dash -eq 1 &&
-			die "$(eval_gettext "'\$arg' does not appear to be a valid revision")"
-			    break
+				test $has_double_dash -eq 1 &&
+				die "$(eval_gettext "'\$arg' does not appear to be a valid revision")"
+				break
 			}
 			case $bad_seen in
 			0) state='bad' ; bad_seen=1 ;;
@@ -125,7 +125,7 @@ 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" --
 		fi
 	else
 		# Get rev from where we start.
@@ -332,7 +332,7 @@ bisect_visualize() {
 	if test $# = 0
 	then
 		if test -n "${DISPLAY+set}${SESSIONNAME+set}${MSYSTEM+set}${SECURITYSESSIONID+set}" &&
-		   type gitk >/dev/null 2>&1
+			type gitk >/dev/null 2>&1
 		then
 			set gitk
 		else
@@ -364,13 +364,11 @@ bisect_reset() {
 	*)
 		usage ;;
 	esac
-	if ! test -f "$GIT_DIR/BISECT_HEAD"
+
+	if ! test -f "$GIT_DIR/BISECT_HEAD" && ! git checkout "$branch" --
 	then
-		if ! git checkout "$branch" --
-		then
-			die "$(eval_gettext "Could not check out original HEAD '\$branch'.
+		die "$(eval_gettext "Could not check out original HEAD '\$branch'.
 Try 'git bisect reset <commit>'.")"
-		fi
 	fi
 	bisect_clean_state
 }

  parent reply	other threads:[~2011-08-05 17:09 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-05 11:31 [PATCH 0/2] bisect: cleanup formatting of git-bisect.sh Jon Seymour
2011-08-05 11:31 ` [PATCH 1/2] bisect: cleanup whitespace errors in git-bisect.sh Jon Seymour
2011-08-05 11:31 ` [PATCH 2/2] bisect: replace "; then" with "\n<tab>*then" Jon Seymour
2011-08-05 17:09 ` Junio C Hamano [this message]
2011-08-06  3:40   ` [PATCH 0/2] bisect: cleanup formatting of git-bisect.sh Jon Seymour

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7vsjpf3hvg.fsf@alter.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=jon.seymour@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).