{"thread":{"id":"10279","subject":"[PATCH 5/7] Bisect: factorise some logging into \"bisect_write\".","startedAt":"2007-10-14T12:29:48Z","lastAt":"2007-10-15T03:35:51Z","messageCount":4,"participants":["Christian Couder","Johannes Schindelin","Lars Hjemli"],"isPatch":true,"patchVersion":1,"patchTotal":7},"messages":[{"id":"55708","messageId":"20071014142948.9f08b8ed.chriscool@tuxfamily.org","threadId":"10279","inReplyTo":null,"subject":"[PATCH 5/7] Bisect: factorise some logging into \"bisect_write\".","fromName":"Christian Couder","fromEmail":"chriscool@tuxfamily.org","sentAt":"2007-10-14T12:29:48Z","receivedAt":"2007-10-14T12:29:48Z","isPatch":true,"sender":{"key":"christian.couder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/208954?v=4"},"body":"Also use \"die\" instead of \"echo >&2 something ; exit 1\".\nAnd simplify \"bisect_replay\".\n\nSigned-off-by: Christian Couder <chriscool@tuxfamily.org>\n---\n git-bisect.sh |   46 +++++++++++++---------------------------------\n 1 files changed, 13 insertions(+), 33 deletions(-)\n\ndiff --git a/git-bisect.sh b/git-bisect.sh\nindex 847250c..e12125f 100755\n--- a/git-bisect.sh\n+++ b/git-bisect.sh\n@@ -106,12 +106,11 @@ bisect_start() {\n \t\t        die \"'$arg' does not appear to be a valid revision\"\n \t\t    break\n \t\t}\n-\t\tif [ $bad_seen -eq 0 ]; then\n-\t\t    bad_seen=1\n-\t\t    bisect_write 'bad' \"$rev\"\n-\t\telse\n-\t\t    bisect_write 'good' \"$rev\"\n-\t\tfi\n+\t\tcase $bad_seen in\n+\t\t0) state='bad' ; bad_seen=1 ;;\n+\t\t*) state='good' ;;\n+\t\tesac\n+\t\tbisect_write \"$state\" \"$rev\" 'nolog'\n \t\tshift\n \t\t;;\n \t    esac\n@@ -132,6 +131,7 @@ bisect_write() {\n \tesac\n \techo \"$rev\" >\"$GIT_DIR/refs/bisect/$tag\"\n \techo \"# $state: \"$(git show-branch $rev) >>\"$GIT_DIR/BISECT_LOG\"\n+\ttest -z \"$nolog\" && echo \"git-bisect $state $rev\" >>\"$GIT_DIR/BISECT_LOG\"\n }\n \n bisect_bad() {\n@@ -145,7 +145,6 @@ bisect_bad() {\n \t\tusage ;;\n \tesac || exit\n \tbisect_write 'bad' \"$rev\"\n-\techo \"git-bisect bad $rev\" >>\"$GIT_DIR/BISECT_LOG\"\n \tbisect_auto_next\n }\n \n@@ -160,7 +159,6 @@ bisect_good() {\n \tdo\n \t\trev=$(git rev-parse --verify \"$rev^{commit}\") || exit\n \t\tbisect_write 'good' \"$rev\"\n-\t\techo \"git-bisect good $rev\" >>\"$GIT_DIR/BISECT_LOG\"\n \tdone\n \tbisect_auto_next\n }\n@@ -176,7 +174,6 @@ bisect_dunno() {\n \tdo\n \t\trev=$(git rev-parse --verify \"$rev^{commit}\") || exit\n \t\tbisect_write 'dunno' \"$rev\"\n-\t\techo \"git-bisect dunno $rev\" >>\"$GIT_DIR/BISECT_LOG\"\n \tdone\n \tbisect_auto_next\n }\n@@ -352,10 +349,8 @@ bisect_reset() {\n \t   else\n \t       branch=master\n \t   fi ;;\n-\t1) git show-ref --verify --quiet -- \"refs/heads/$1\" || {\n-\t       echo >&2 \"$1 does not seem to be a valid branch\"\n-\t       exit 1\n-\t   }\n+\t1) git show-ref --verify --quiet -- \"refs/heads/$1\" ||\n+\t       die \"$1 does not seem to be a valid branch\"\n \t   branch=\"$1\" ;;\n \t*)\n \t    usage ;;\n@@ -375,10 +370,7 @@ bisect_clean_state() {\n }\n \n bisect_replay () {\n-\ttest -r \"$1\" || {\n-\t\techo >&2 \"cannot read $1 for replaying\"\n-\t\texit 1\n-\t}\n+\ttest -r \"$1\" || die \"cannot read $1 for replaying\"\n \tbisect_reset\n \twhile read bisect command rev\n \tdo\n@@ -386,23 +378,11 @@ bisect_replay () {\n \t\tcase \"$command\" in\n \t\tstart)\n \t\t\tcmd=\"bisect_start $rev\"\n-\t\t\teval \"$cmd\"\n-\t\t\t;;\n-\t\tgood)\n-\t\t\tbisect_write 'good' \"$rev\"\n-\t\t\techo \"git-bisect good $rev\" >>\"$GIT_DIR/BISECT_LOG\"\n-\t\t\t;;\n-\t\tbad)\n-\t\t\tbisect_write 'bad' \"$rev\"\n-\t\t\techo \"git-bisect bad $rev\" >>\"$GIT_DIR/BISECT_LOG\"\n-\t\t\t;;\n-\t\tdunno)\n-\t\t\tbisect_write 'dunno' \"$rev\"\n-\t\t\techo \"git-bisect dunno $rev\" >>\"$GIT_DIR/BISECT_LOG\"\n-\t\t\t;;\n+\t\t\teval \"$cmd\" ;;\n+\t\tgood|bad|dunno)\n+\t\t\tbisect_write \"$command\" \"$rev\" ;;\n \t\t*)\n-\t\t\techo >&2 \"?? what are you talking about?\"\n-\t\t\texit 1 ;;\n+\t\t\tdie \"?? what are you talking about?\" ;;\n \t\tesac\n \tdone <\"$1\"\n \tbisect_auto_next\n-- \n1.5.3.4.213.g68ad5\n"},{"id":"55727","messageId":"Pine.LNX.4.64.0710141706440.25221@racer.site","threadId":"10279","inReplyTo":"20071014142948.9f08b8ed.chriscool@tuxfamily.org","subject":"Re: [PATCH 5/7] Bisect: factorise some logging into \"bisect_write\".","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-10-14T16:07:46Z","receivedAt":"2007-10-14T16:07:46Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Sun, 14 Oct 2007, Christian Couder wrote:\n\n> diff --git a/git-bisect.sh b/git-bisect.sh\n> index 847250c..e12125f 100755\n> --- a/git-bisect.sh\n> +++ b/git-bisect.sh\n> @@ -132,6 +131,7 @@ bisect_write() {\n>  \tesac\n>  \techo \"$rev\" >\"$GIT_DIR/refs/bisect/$tag\"\n>  \techo \"# $state: \"$(git show-branch $rev) >>\"$GIT_DIR/BISECT_LOG\"\n> +\ttest -z \"$nolog\" && echo \"git-bisect $state $rev\" >>\"$GIT_DIR/BISECT_LOG\"\n>  }\n\nIsn't a nolog=\"$3\" missing from bisect_write()?\n\nCiao,\nDscho\n"},{"id":"55791","messageId":"8c5c35580710141540j6f93a08j2179c5c394bfacd5@mail.gmail.com","threadId":"10279","inReplyTo":"Pine.LNX.4.64.0710141706440.25221@racer.site","subject":"Re: [PATCH 5/7] Bisect: factorise some logging into \"bisect_write\".","fromName":"Lars Hjemli","fromEmail":"lh@elementstorage.no","sentAt":"2007-10-14T22:40:22Z","receivedAt":"2007-10-14T22:40:22Z","isPatch":true,"sender":{"key":"lh@elementstorage.no","avatar":null},"body":"On 10/14/07, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:\n> On Sun, 14 Oct 2007, Christian Couder wrote:\n> > diff --git a/git-bisect.sh b/git-bisect.sh\n> > index 847250c..e12125f 100755\n> > --- a/git-bisect.sh\n> > +++ b/git-bisect.sh\n> > @@ -132,6 +131,7 @@ bisect_write() {\n> >       esac\n> >       echo \"$rev\" >\"$GIT_DIR/refs/bisect/$tag\"\n> >       echo \"# $state: \"$(git show-branch $rev) >>\"$GIT_DIR/BISECT_LOG\"\n> > +     test -z \"$nolog\" && echo \"git-bisect $state $rev\" >>\"$GIT_DIR/BISECT_LOG\"\n> >  }\n>\n> Isn't a nolog=\"$3\" missing from bisect_write()?\n\nGood catch, I've amended the commit and replaced q/cc/bisect-dunno\nwith this series.\n\n--\nlarsh\n"},{"id":"55805","messageId":"200710150535.51613.chriscool@tuxfamily.org","threadId":"10279","inReplyTo":"8c5c35580710141540j6f93a08j2179c5c394bfacd5@mail.gmail.com","subject":"Re: [PATCH 5/7] Bisect: factorise some logging into \"bisect_write\".","fromName":"Christian Couder","fromEmail":"chriscool@tuxfamily.org","sentAt":"2007-10-15T03:35:51Z","receivedAt":"2007-10-15T03:35:51Z","isPatch":true,"sender":{"key":"christian.couder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/208954?v=4"},"body":"Le lundi 15 octobre 2007, Lars Hjemli a écrit :\n> On 10/14/07, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:\n> >\n> > Isn't a nolog=\"$3\" missing from bisect_write()?\n\nYes, you are right. I forgot this line when reorganizing patches before \nsubmitting. Thanks.\n\n> Good catch, I've amended the commit and replaced q/cc/bisect-dunno\n> with this series.\n\nThanks,\nChristian.\n"}]}