{"thread":{"id":"10446","subject":"[PATCH 1/3] Bisect: refactor \"bisect_write_*\" functions.","startedAt":"2007-10-24T05:01:05Z","lastAt":"2007-10-24T05:01:05Z","messageCount":1,"participants":["Christian Couder"],"isPatch":true,"patchVersion":1,"patchTotal":3},"messages":[{"id":"57056","messageId":"20071024070105.2381ab12.chriscool@tuxfamily.org","threadId":"10446","inReplyTo":null,"subject":"[PATCH 1/3] Bisect: refactor \"bisect_write_*\" functions.","fromName":"Christian Couder","fromEmail":"chriscool@tuxfamily.org","sentAt":"2007-10-24T05:01:05Z","receivedAt":"2007-10-24T05:01:05Z","isPatch":true,"sender":{"key":"christian.couder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/208954?v=4"},"body":"Signed-off-by: Christian Couder <chriscool@tuxfamily.org>\nSigned-off-by: Shawn O. Pearce <spearce@spearce.org>\n---\n git-bisect.sh |   46 ++++++++++++++++++++--------------------------\n 1 files changed, 20 insertions(+), 26 deletions(-)\n\n\tThis patch series change the title of 3 patches in the\n\t\"bisect skip\" series from \"Bisect: factorise ...\" to\n\t\"Bisect: refactor ...\".\n\tIn the second patch in this series a missing line has\n\talso been added back. \n\ndiff --git a/git-bisect.sh b/git-bisect.sh\nindex cd46190..82aa404 100755\n--- a/git-bisect.sh\n+++ b/git-bisect.sh\n@@ -108,9 +108,9 @@ bisect_start() {\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\t    bisect_write 'bad' \"$rev\"\n \t\telse\n-\t\t    bisect_write_good \"$rev\"\n+\t\t    bisect_write 'good' \"$rev\"\n \t\tfi\n \t\tshift\n \t\t;;\n@@ -122,6 +122,18 @@ bisect_start() {\n \tbisect_auto_next\n }\n \n+bisect_write() {\n+\tstate=\"$1\"\n+\trev=\"$2\"\n+\tcase \"$state\" in\n+\t\tbad)\t\ttag=\"$state\" ;;\n+\t\tgood|skip)\ttag=\"$state\"-\"$rev\" ;;\n+\t\t*)\t\tdie \"Bad bisect_write argument: $state\" ;;\n+\tesac\n+\techo \"$rev\" >\"$GIT_DIR/refs/bisect/$tag\"\n+\techo \"# $state: \"$(git show-branch $rev) >>\"$GIT_DIR/BISECT_LOG\"\n+}\n+\n bisect_bad() {\n \tbisect_autostart\n \tcase \"$#\" in\n@@ -132,17 +144,11 @@ bisect_bad() {\n \t*)\n \t\tusage ;;\n \tesac || exit\n-\tbisect_write_bad \"$rev\"\n+\tbisect_write 'bad' \"$rev\"\n \techo \"git-bisect bad $rev\" >>\"$GIT_DIR/BISECT_LOG\"\n \tbisect_auto_next\n }\n \n-bisect_write_bad() {\n-\trev=\"$1\"\n-\techo \"$rev\" >\"$GIT_DIR/refs/bisect/bad\"\n-\techo \"# bad: \"$(git show-branch $rev) >>\"$GIT_DIR/BISECT_LOG\"\n-}\n-\n bisect_good() {\n \tbisect_autostart\n \tcase \"$#\" in\n@@ -153,18 +159,12 @@ bisect_good() {\n \tfor rev in $revs\n \tdo\n \t\trev=$(git rev-parse --verify \"$rev^{commit}\") || exit\n-\t\tbisect_write_good \"$rev\"\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 \n-bisect_write_good() {\n-\trev=\"$1\"\n-\techo \"$rev\" >\"$GIT_DIR/refs/bisect/good-$rev\"\n-\techo \"# good: \"$(git show-branch $rev) >>\"$GIT_DIR/BISECT_LOG\"\n-}\n-\n bisect_skip() {\n \tbisect_autostart\n \tcase \"$#\" in\n@@ -175,18 +175,12 @@ bisect_skip() {\n \tfor rev in $revs\n \tdo\n \t\trev=$(git rev-parse --verify \"$rev^{commit}\") || exit\n-\t\tbisect_write_skip \"$rev\"\n+\t\tbisect_write 'skip' \"$rev\"\n \t\techo \"git-bisect skip $rev\" >>\"$GIT_DIR/BISECT_LOG\"\n \tdone\n \tbisect_auto_next\n }\n \n-bisect_write_skip() {\n-\trev=\"$1\"\n-\techo \"$rev\" >\"$GIT_DIR/refs/bisect/skip-$rev\"\n-\techo \"# skip: \"$(git show-branch $rev) >>\"$GIT_DIR/BISECT_LOG\"\n-}\n-\n bisect_next_check() {\n \tmissing_good= missing_bad=\n \tgit show-ref -q --verify refs/bisect/bad || missing_bad=t\n@@ -395,15 +389,15 @@ bisect_replay () {\n \t\t\teval \"$cmd\"\n \t\t\t;;\n \t\tgood)\n-\t\t\tbisect_write_good \"$rev\"\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\tbisect_write 'bad' \"$rev\"\n \t\t\techo \"git-bisect bad $rev\" >>\"$GIT_DIR/BISECT_LOG\"\n \t\t\t;;\n \t\tskip)\n-\t\t\tbisect_write_skip \"$rev\"\n+\t\t\tbisect_write 'skip' \"$rev\"\n \t\t\techo \"git-bisect skip $rev\" >>\"$GIT_DIR/BISECT_LOG\"\n \t\t\t;;\n \t\t*)\n-- \n1.5.3.4.215.g187cf\n"}]}