git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Matthieu Moy <Matthieu.Moy@imag.fr>
To: gitster@pobox.com
Cc: git@vger.kernel.org, antoine.delaite@ensimag.grenoble-inp.fr,
	louis--alexandre.stuber@ensimag.grenoble-inp.fr,
	chriscool@tuxfamily.org, thomasxnguy@gmail.com,
	valentinduperray@gmail.com, Matthieu Moy <Matthieu.Moy@imag.fr>
Subject: [PATCH v11 06/10] bisect: don't mix option parsing and non-trivial code
Date: Mon, 29 Jun 2015 17:40:31 +0200	[thread overview]
Message-ID: <1435592435-27914-7-git-send-email-Matthieu.Moy@imag.fr> (raw)
In-Reply-To: <1435592435-27914-1-git-send-email-Matthieu.Moy@imag.fr>

As-is, the revisions that appear on the command-line are processed in
order. This would mix badly with code that changes the configuration
(e.g. change $TERM_GOOD and $TERM_BAD) while processing the options.

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
---
 git-bisect.sh | 30 +++++++++++++++++-------------
 1 file changed, 17 insertions(+), 13 deletions(-)

diff --git a/git-bisect.sh b/git-bisect.sh
index dcd7e59..f32fd2d 100755
--- a/git-bisect.sh
+++ b/git-bisect.sh
@@ -78,6 +78,7 @@ bisect_start() {
 	bad_seen=0
 	eval=''
 	must_write_terms=0
+	revs=''
 	if test "z$(git rev-parse --is-bare-repository)" != zfalse
 	then
 		mode=--no-checkout
@@ -102,25 +103,27 @@ bisect_start() {
 				die "$(eval_gettext "'\$arg' does not appear to be a valid revision")"
 				break
 			}
-
-			# The user ran "git bisect start <sha1>
-			# <sha1>", hence did not explicitly specify
-			# the terms, but we are already starting to
-			# set references named with the default terms,
-			# and won't be able to change afterwards.
-			must_write_terms=1
-
-			case $bad_seen in
-			0) state=$TERM_BAD ; bad_seen=1 ;;
-			*) state=$TERM_GOOD ;;
-			esac
-			eval="$eval bisect_write '$state' '$rev' 'nolog' &&"
+			revs="$revs $rev"
 			shift
 			;;
 		esac
 	done
 
+	for rev in $revs
+	do
+		# The user ran "git bisect start <sha1>
+		# <sha1>", hence did not explicitly specify
+		# the terms, but we are already starting to
+		# set references named with the default terms,
+		# and won't be able to change afterwards.
+		must_write_terms=1
+
+		case $bad_seen in
+		0) state=$TERM_BAD ; bad_seen=1 ;;
+		*) state=$TERM_GOOD ;;
+		esac
+		eval="$eval bisect_write '$state' '$rev' 'nolog' &&"
+	done
 	#
 	# Verify HEAD.
 	#
-- 
2.5.0.rc0.10.gd2bff5d

  parent reply	other threads:[~2015-06-29 15:41 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-29 15:40 [PATCH v11 00/10] bisect terms Matthieu Moy
2015-06-29 15:40 ` [PATCH v11 01/10] bisect: correction of typo Matthieu Moy
2015-06-29 15:40 ` [PATCH v11 02/10] Documentation/bisect: move getting help section to the end Matthieu Moy
2015-06-29 15:40 ` [PATCH v11 03/10] Documentation/bisect: revise overall content Matthieu Moy
2015-06-29 15:40 ` [PATCH v11 04/10] bisect: replace hardcoded "bad|good" by variables Matthieu Moy
2015-06-29 15:40 ` [PATCH v11 05/10] bisect: simplify the addition of new bisect terms Matthieu Moy
2015-06-29 15:40 ` Matthieu Moy [this message]
2015-06-29 20:28   ` [PATCH v11 06/10] bisect: don't mix option parsing and non-trivial code Junio C Hamano
2015-06-30 11:46     ` Matthieu Moy
2015-06-30 15:56       ` Junio C Hamano
2015-06-29 15:40 ` [PATCH v11 07/10] bisect: sanity check on terms Matthieu Moy
2015-06-29 15:40 ` [PATCH v11 08/10] bisect: add the terms old/new Matthieu Moy
2015-06-29 15:40 ` [PATCH v11 09/10] bisect: add 'git bisect terms' to view the current terms Matthieu Moy
2015-06-29 15:40 ` [PATCH v11 10/10] bisect: allow setting any user-specified in 'git bisect start' Matthieu Moy
2015-06-29 16:44 ` [PATCH v11 00/10] bisect terms Junio C Hamano

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=1435592435-27914-7-git-send-email-Matthieu.Moy@imag.fr \
    --to=matthieu.moy@imag.fr \
    --cc=antoine.delaite@ensimag.grenoble-inp.fr \
    --cc=chriscool@tuxfamily.org \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=louis--alexandre.stuber@ensimag.grenoble-inp.fr \
    --cc=thomasxnguy@gmail.com \
    --cc=valentinduperray@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).