Thread (1 message) 1 message, 1 author, 2016-06-15

Re: [PATCH v2 7/7] bisect: allows any terms set by user

From: Matthieu Moy <hidden>
Date: 2016-06-15 23:05:15

Junio C Hamano [off-list ref] writes:
Junio C Hamano [off-list ref] writes:
quoted
+bisect_terms () {
+	test $# -eq 2 ||
+	die "You need to give me at least two arguments"
+
+	if ! test -s "$GIT_DIR/BISECT_START"
+	then
+		echo $1 >"$GIT_DIR/BISECT_TERMS" &&
+		echo $2 >>"$GIT_DIR/BISECT_TERMS" &&
+		echo "1" > "$GIT_DIR/TERMS_DEFINED"
+	else
+		die "A bisection has already started, please use "\
+		"'git bisect reset' to restart and change the terms"
+	fi
+}
+
I think "git bisect terms" is a good way to help a user to recall
what two names s/he decided to use for the current session.  So
dying 'already started' with suggestion for 'reset' is OK, but at
the same time, helping the user to continue the current bisection by
giving a message along the lines of "You are hunting for a commit
that is at the boundary of the old state (you are calling it
'$NAME_OLD') and the new state ('$NAME_NEW')" would be a good idea.
I'd put a very verbose message explaining the situation and the way out
(use 'git bisect') for the second "die", and I would consider "git
bisect terms" without arguments as a valid command to ask "please tell
me what the terms are".

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help