git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Christian Couder <chriscool@tuxfamily.org>
Date
Feb 27, 2009, 06:31 UTC
Message-ID
<20090227073146.6699964f.chriscool@tuxfamily.org>

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 <chriscool@tuxfamily.org>
---
 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
Next: Junio C Hamano
Message 1 of 2 in “bisect: string commands emited by "filter_skipped" together with "&&"”
  1. 2/2 bisect: string commands emited by "filter_skipped" together with "&&"Christian Couder, Feb 27, 2009
  2. Junio C HamanoFeb 27, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.