{"thread":{"id":"18616","subject":"[PATCH] bisect: avoid pipes to better catch \"git rev-list\" errors","startedAt":"2009-03-29T09:58:32Z","lastAt":"2009-04-11T00:52:47Z","messageCount":3,"participants":["Christian Couder","Nanako Shiraishi","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"109763","messageId":"20090329115832.28acd74e.chriscool@tuxfamily.org","threadId":"18616","inReplyTo":null,"subject":"[PATCH] bisect: avoid pipes to better catch \"git rev-list\" errors","fromName":"Christian Couder","fromEmail":"chriscool@tuxfamily.org","sentAt":"2009-03-29T09:58:32Z","receivedAt":"2009-03-29T09:58:32Z","isPatch":true,"sender":{"key":"christian.couder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/208954?v=4"},"body":"When doing:\n\neval \"git rev-list --bisect-vars ...\" | {\n        while read line\n        do\n                echo \"$line &&\"\n        done\n        echo ':'\n}\n\nthe result code comes from the last \"echo ':'\", not from running\n\"git rev-list --bisect-vars ...\".\n\nThis means that we may miss errors from \"git rev-list\".\n\nTo fix that, this patch gets rid of the pipes by redirecting the\noutput of \"git rev-list\" into a file, and then reading from this\nfile.\n\nSigned-off-by: Christian Couder <chriscool@tuxfamily.org>\n---\n git-bisect.sh |   16 ++++++++++------\n 1 files changed, 10 insertions(+), 6 deletions(-)\n\nThis applies to master.\n\ndiff --git a/git-bisect.sh b/git-bisect.sh\nindex e313bde..45214ca 100755\n--- a/git-bisect.sh\n+++ b/git-bisect.sh\n@@ -284,19 +284,22 @@ filter_skipped() {\n \t_skip=\"$2\"\n \n \tif [ -z \"$_skip\" ]; then\n-\t\teval \"$_eval\" | {\n+\t\teval \"$_eval\" > \"$GIT_DIR/BISECT_EVAL_TMP\" &&\n+\t\t{\n \t\t\twhile read line\n \t\t\tdo\n \t\t\t\techo \"$line &&\"\n-\t\t\tdone\n+\t\t\tdone < \"$GIT_DIR/BISECT_EVAL_TMP\" &&\n \t\t\techo ':'\n-\t\t}\n+\t\t} &&\n+\t\trm -f \"$GIT_DIR/BISECT_EVAL_TMP\"\n \t\treturn\n \tfi\n \n \t# Let's parse the output of:\n \t# \"git rev-list --bisect-vars --bisect-all ...\"\n-\teval \"$_eval\" | {\n+\teval \"$_eval\" > \"$GIT_DIR/BISECT_EVAL_TMP\" &&\n+\t{\n \t\tVARS= FOUND= TRIED=\n \t\twhile read hash line\n \t\tdo\n@@ -349,9 +352,10 @@ filter_skipped() {\n \t\t\t\t    \"line: '$line'\"\n \t\t\t\t;;\n \t\t\tesac\n-\t\tdone\n+\t\tdone < \"$GIT_DIR/BISECT_EVAL_TMP\" &&\n \t\techo ':'\n-\t}\n+\t} &&\n+\trm -f \"$GIT_DIR/BISECT_EVAL_TMP\"\n }\n \n exit_if_skipped_commits () {\n-- \n1.6.2.1.404.gb0085.dirty\n"},{"id":"110975","messageId":"20090410093436.6117@nanako3.lavabit.com","threadId":"18616","inReplyTo":"20090329115832.28acd74e.chriscool@tuxfamily.org","subject":"Re: [PATCH] bisect: avoid pipes to better catch \"git rev-list\" errors","fromName":"Nanako Shiraishi","fromEmail":"nanako3@lavabit.com","sentAt":"2009-04-10T00:34:36Z","receivedAt":"2009-04-10T00:34:36Z","isPatch":true,"sender":{"key":"nanako3@lavabit.com","avatar":"https://gravatar.com/avatar/3777b9e201c5883a62b1a6fdf7c53f2d712d1d80989146063ea861e33aad72a8?d=mp&s=160"},"body":"Quoting Christian Couder:\n\n> When doing:\n> \n> eval \"git rev-list --bisect-vars ...\" | {\n>         while read line\n>         do\n>                 echo \"$line &&\"\n>         done\n>         echo ':'\n> }\n> \n> the result code comes from the last \"echo ':'\", not from running\n> \"git rev-list --bisect-vars ...\".\n> \n> This means that we may miss errors from \"git rev-list\".\n> \n> To fix that, this patch gets rid of the pipes by redirecting the\n> output of \"git rev-list\" into a file, and then reading from this\n> file.\n> \n> Signed-off-by: Christian Couder <chriscool@tuxfamily.org>\n\nJunio, may I ask what happened to this patch?\n\n-- \nNanako Shiraishi\nhttp://ivory.ap.teacup.com/nanako3/\n"},{"id":"111033","messageId":"7veiw0nh9c.fsf@gitster.siamese.dyndns.org","threadId":"18616","inReplyTo":"20090410093436.6117@nanako3.lavabit.com","subject":"Re: [PATCH] bisect: avoid pipes to better catch \"git rev-list\" errors","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-04-11T00:52:47Z","receivedAt":"2009-04-11T00:52:47Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Nanako Shiraishi <nanako3@lavabit.com> writes:\n\n> Quoting Christian Couder:\n>\n>> When doing:\n>> \n>> eval \"git rev-list --bisect-vars ...\" | {\n>>         while read line\n>>         do\n>>                 echo \"$line &&\"\n>>         done\n>>         echo ':'\n>> }\n>> \n>> the result code comes from the last \"echo ':'\", not from running\n>> \"git rev-list --bisect-vars ...\".\n>> \n>> This means that we may miss errors from \"git rev-list\".\n>> \n>> To fix that, this patch gets rid of the pipes by redirecting the\n>> output of \"git rev-list\" into a file, and then reading from this\n>> file.\n>> \n>> Signed-off-by: Christian Couder <chriscool@tuxfamily.org>\n>\n> Junio, may I ask what happened to this patch?\n\nI've chosen to ignore it, hoping that Christian's other bisect topic to\nstabilize soon.  That will make this patch unnecessary, I think.\n"}]}