{"thread":{"id":"18041","subject":"[PATCH 2/2] bisect: string commands emited by \"filter_skipped\" together with \"&&\"","startedAt":"2009-02-27T06:31:46Z","lastAt":"2009-02-27T07:01:18Z","messageCount":2,"participants":["Christian Couder","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":2},"messages":[{"id":"106398","messageId":"20090227073146.6699964f.chriscool@tuxfamily.org","threadId":"18041","inReplyTo":null,"subject":"[PATCH 2/2] bisect: string commands emited by \"filter_skipped\" together with \"&&\"","fromName":"Christian Couder","fromEmail":"chriscool@tuxfamily.org","sentAt":"2009-02-27T06:31:46Z","receivedAt":"2009-02-27T06:31:46Z","isPatch":true,"sender":{"key":"christian.couder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/208954?v=4"},"body":"So that when they are evaled and there is an error, the result from\nthe eval is an error.\n\nThis way we should be protected from errors in the output emited by\n\"filter_skipped\".\n\nSigned-off-by: Christian Couder <chriscool@tuxfamily.org>\n---\n git-bisect.sh |   29 ++++++++++++++++-------------\n 1 files changed, 16 insertions(+), 13 deletions(-)\n\ndiff --git a/git-bisect.sh b/git-bisect.sh\nindex a9324b2..08e31d6 100755\n--- a/git-bisect.sh\n+++ b/git-bisect.sh\n@@ -296,14 +296,14 @@ filter_skipped() {\n \tdo\n \t\tcase \"$VARS,$FOUND,$TRIED,$hash\" in\n \t\t\t# We display some vars.\n-\t\t\t1,*,*,*) echo \"$hash $line\" ;;\n+\t\t\t1,*,*,*) echo \"$hash $line &&\" ;;\n \n \t\t\t# Split line.\n \t\t\t,*,*,---*) ;;\n \n \t\t\t# We had nothing to search.\n \t\t\t,,,bisect_rev*)\n-\t\t\t\techo \"bisect_rev=\"\n+\t\t\t\techo \"bisect_rev= &&\"\n \t\t\t\tVARS=1\n \t\t\t\t;;\n \n@@ -311,7 +311,7 @@ filter_skipped() {\n \t\t\t# This should happen only if the \"bad\"\n \t\t\t# commit is also a \"skip\" commit.\n \t\t\t,,*,bisect_rev*)\n-\t\t\t\techo \"bisect_rev='$TRIED'\"\n+\t\t\t\techo \"bisect_rev='$TRIED' &&\"\n \t\t\t\tVARS=1\n \t\t\t\t;;\n \n@@ -321,8 +321,8 @@ filter_skipped() {\n \t\t\t\tcase \"$_skip\" in\n \t\t\t\t*$hash*) ;;\n \t\t\t\t*)\n-\t\t\t\t\techo \"bisect_rev=$hash\"\n-\t\t\t\t\techo \"bisect_tried='$TRIED'\"\n+\t\t\t\t\techo \"bisect_rev=$hash &&\"\n+\t\t\t\t\techo \"bisect_tried='$TRIED' &&\"\n \t\t\t\t\tFOUND=1\n \t\t\t\t\t;;\n \t\t\t\tesac\n@@ -332,16 +332,19 @@ filter_skipped() {\n \t\t\t,1,*,bisect_rev*) VARS=1 ;;\n \t\t\t,1,*,*) ;;\n \n-\t\t\t# ???\n-\t\t\t*) die \"filter_skipped error \" \\\n-\t\t\t    \"VARS: '$VARS' \" \\\n-\t\t\t    \"FOUND: '$FOUND' \" \\\n-\t\t\t    \"TRIED: '$TRIED' \" \\\n-\t\t\t    \"hash: '$hash' \" \\\n-\t\t\t    \"line: '$line'\"\n-\t\t\t;;\n+\t\t\t# Unexpected input\n+\t\t\t*)\n+\t\t\t\techo \"die 'filter_skipped error'\"\n+\t\t\t\tdie \"filter_skipped error \" \\\n+\t\t\t\t    \"VARS: '$VARS' \" \\\n+\t\t\t\t    \"FOUND: '$FOUND' \" \\\n+\t\t\t\t    \"TRIED: '$TRIED' \" \\\n+\t\t\t\t    \"hash: '$hash' \" \\\n+\t\t\t\t    \"line: '$line'\"\n+\t\t\t\t;;\n \t\tesac\n \tdone\n+\techo ':'\n }\n \n exit_if_skipped_commits () {\n-- \n1.6.2.rc1.257.g6c75\n"},{"id":"106402","messageId":"7v4oygnz29.fsf@gitster.siamese.dyndns.org","threadId":"18041","inReplyTo":"20090227073146.6699964f.chriscool@tuxfamily.org","subject":"Re: [PATCH 2/2] bisect: string commands emited by \"filter_skipped\" together with \"&&\"","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-02-27T07:01:18Z","receivedAt":"2009-02-27T07:01:18Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Christian Couder <chriscool@tuxfamily.org> writes:\n\n> diff --git a/git-bisect.sh b/git-bisect.sh\n> index a9324b2..08e31d6 100755\n> --- a/git-bisect.sh\n> +++ b/git-bisect.sh\n> @@ -296,14 +296,14 @@ filter_skipped() {\n>  \tdo\n> ...\n>  \tdone\n> +\techo ':'\n\nIs there a particular reason you moved this echo ':' out of the downstream\nof the pipe as I wrote in my response?\n\nIt logically belongs to the downstream in this pattern:\n\n        producer of the list of items | {\n                preparatory steps\n                while read one item\n                do\n                        process one item\n                        echo \"something &&\"\n                done\n                echo \":\" ;# to conclude the && chain\n        }\n\nBut you changed it to:\n\n        preparatory step that does not concern producer\n\n        producer of the list of items |\n                while read one item\n                do\n                        process one item\n                        echo \"something &&\"\n                done\n\n        echo \":\"\n\nwhich looks to me a lot less logical code structure.\n"}]}