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

5 messages, 3 authors, 2016-06-15 · open the first message on its own page

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

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

Antoine Delaite [off-list ref] writes:
-	# start_bad_good is used to detect if we did a 
-	# 'git bisect start bad_rev good_rev'
-	start_bad_good=0
+	# terms_defined is used to detect if we did a
+	# 'git bisect start bad_rev good_rev' or if the user
+	# defined his own terms with git bisect terms
+	terms_defined=0
Modifying in PATCH 7 some code that you introduced in PATCH 3 is
suspicious. Is there any reason you did not name the variable
"terms_defined" in the first place? (i.e. squash this hunk and the other
instance of start_bad_good into PATCH 3)

(Whether this is a rethorical question is up to you ;-) )
+	if test -s "$GIT_DIR/TERMS_DEFINED"
+	then
+		terms_defined=1
+		get_terms
+		rm -rf "$GIT_DIR/TERMS_DEFINED"
I don't understand why you need to delete this file. I did not review
thoroughly so there may be a reason, but you can help the reader with a
comment here.
+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"
Space after >.
quoted hunk
@@ -574,7 +600,7 @@ case "$#" in
 		git bisect -h ;;
 	start)
 		bisect_start "$@" ;;
-	bad|good|new|old)
+	bad|good|new|old|$NAME_BAD|$NAME_GOOD)
See my other message about quoting.

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/

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

From: Louis-Alexandre Stuber <hidden>
Date: 2016-06-15 23:05:18

Matthieu Moy [off-list ref] writes:
Modifying in PATCH 7 some code that you introduced in PATCH 3 is
suspicious. Is there any reason you did not name the variable
"terms_defined" in the first place? (i.e. squash this hunk and the other
instance of start_bad_good into PATCH 3)

(Whether this is a rethorical question is up to you ;-) )
In the previouses versions where we only want to introduce old/new,
the terms can only be defined in bisect_start if the user typed
start <bad> <good>. The name "start_bad_good" is not very explicit
indeed, but isn't it more appropriate in this case than terms_defined ?
I don't understand why you need to delete this file. I did not review
thoroughly so there may be a reason, but you can help the reader with a
comment here.
I think it's a mistake. I'd say we should put this test just before the
"bisect_clean_state || exit" line, but that would deserve more attention
indeed. The idea is to delete the file at the right moment because we 
don't want it to exist again when the user starts an other bisection,
but also have an intelligent behaviour if the start command fails.

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

From: Antoine Delaite <hidden>
Date: 2016-06-15 23:05:18

Louis Stuber [off-list ref] writes: 
Matthieu Moy [off-list ref] writes: 
quoted
Modifying in PATCH 7 some code that you introduced in PATCH 3 is 
suspicious. Is there any reason you did not name the variable 
"terms_defined" in the first place? (i.e. squash this hunk and the other 
instance of start_bad_good into PATCH 3) 

(Whether this is a rethorical question is up to you ;-) ) 
In the previouses versions where we only want to introduce old/new, 
the terms can only be defined in bisect_start if the user typed 
start <bad> <good>. The name "start_bad_good" is not very explicit 
indeed, but isn't it more appropriate in this case than terms_defined ? 
I agree with Louis, but maybe a consistant commit history is more 
important. But if only the first patches (which implement old/new ) 
would come to be accepted the name of the variable would sounds strange. 
quoted
I don't understand why you need to delete this file. I did not review 
thoroughly so there may be a reason, but you can help the reader with a 
comment here. 
I think it's a mistake. I'd say we should put this test just before the 
"bisect_clean_state || exit" line, but that would deserve more attention 
indeed. The idea is to delete the file at the right moment because we 
don't want it to exist again when the user starts an other bisection, 
but also have an intelligent behaviour if the start command fails. 
Yes if the start commands fails, like if you gave wrong sha1, it would be 
nice not to have to type again 'git bisect terms ...' . There is no use to 
put it before clean_state because clean_state because clean_state will 
actually delete the file. So we can just let clean_state do this. 

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

From: Antoine Delaite <hidden>
Date: 2016-06-15 23:05:18

Matthieu Moy [off-list ref] writes:
quoted
+        if test -s "$GIT_DIR/TERMS_DEFINED"
+        then
+                terms_defined=1
+                get_terms
+                rm -rf "$GIT_DIR/TERMS_DEFINED"
I don't understand why you need to delete this file. I did not review
thoroughly so there may be a reason, but you can help the reader with a
comment here.
I will just complete Louis' answer. We delete it with backward
compatibility with old/new in mind (even if old/new is not merged yet).
For instance, after a old/new mode, if you do a 'bisect start rev1 rev2'
the mode would be bad/good ie the default mode. So if you defined your
terms, we decided it would only be for the following bisection. The next 
'bisect start rev1 rev2' would be in bad/good mode.
But this have to be discuted, do the user have to type 'git bisect terms'
each bisection if he wants to use special terms ?

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

From: Antoine Delaite <hidden>
Date: 2016-06-15 23:05:18

This message's goal is to explained where am I on the bisect 
functions. 

-git bisect replay now work with any terms. 
-I took account of most of the last reviews (coding style, 
double sed ...)
-'git bisect terms' without arguments now display the current 
terms 
-bisect_terms : if a bisection has already started, a more 
verbose message is displayed 
-I solved a merge conflict in bisect.c due to the update of 
master branch. 

To submit a v3 I would need answer about how we rebase the commit 
history and what do we do to simplify the life of the user with the 
terms (see my last mails). 
I was thinking of: 
-a config variable that would say :"as long as I don't reset keep 
the terms of the previous bisection" 
or we could decided that this is the default behaviour of bisect. 

-two config variables to choose default terms 

I may have less time in the next days but I would like to submit a v3. 
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help