DORMANTno replies

[PATCH 2/2] bisect: string commands emited by "filter_skipped" together with "&&"

From: Christian Couder <hidden>
Date: 2016-06-15 22:46:17
Subsystem: the rest · Maintainer: Linus Torvalds

So that when they are evaled and there is an error, the result from
the eval is an error.

This way we should be protected from errors in the output emited by
"filter_skipped".

Signed-off-by: Christian Couder <redacted>
---
 git-bisect.sh |   29 ++++++++++++++++-------------
 1 files changed, 16 insertions(+), 13 deletions(-)
diff --git a/git-bisect.sh b/git-bisect.sh
index a9324b2..08e31d6 100755
--- a/git-bisect.sh
+++ b/git-bisect.sh
@@ -296,14 +296,14 @@ filter_skipped() {
 	do
 		case "$VARS,$FOUND,$TRIED,$hash" in
 			# We display some vars.
-			1,*,*,*) echo "$hash $line" ;;
+			1,*,*,*) echo "$hash $line &&" ;;
 
 			# Split line.
 			,*,*,---*) ;;
 
 			# We had nothing to search.
 			,,,bisect_rev*)
-				echo "bisect_rev="
+				echo "bisect_rev= &&"
 				VARS=1
 				;;
 
@@ -311,7 +311,7 @@ filter_skipped() {
 			# This should happen only if the "bad"
 			# commit is also a "skip" commit.
 			,,*,bisect_rev*)
-				echo "bisect_rev='$TRIED'"
+				echo "bisect_rev='$TRIED' &&"
 				VARS=1
 				;;
 
@@ -321,8 +321,8 @@ filter_skipped() {
 				case "$_skip" in
 				*$hash*) ;;
 				*)
-					echo "bisect_rev=$hash"
-					echo "bisect_tried='$TRIED'"
+					echo "bisect_rev=$hash &&"
+					echo "bisect_tried='$TRIED' &&"
 					FOUND=1
 					;;
 				esac
@@ -332,16 +332,19 @@ filter_skipped() {
 			,1,*,bisect_rev*) VARS=1 ;;
 			,1,*,*) ;;
 
-			# ???
-			*) die "filter_skipped error " \
-			    "VARS: '$VARS' " \
-			    "FOUND: '$FOUND' " \
-			    "TRIED: '$TRIED' " \
-			    "hash: '$hash' " \
-			    "line: '$line'"
-			;;
+			# Unexpected input
+			*)
+				echo "die 'filter_skipped error'"
+				die "filter_skipped error " \
+				    "VARS: '$VARS' " \
+				    "FOUND: '$FOUND' " \
+				    "TRIED: '$TRIED' " \
+				    "hash: '$hash' " \
+				    "line: '$line'"
+				;;
 		esac
 	done
+	echo ':'
 }
 
 exit_if_skipped_commits () {
-- 
1.6.2.rc1.257.g6c75
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help