{"thread":{"id":"27969","subject":"[PATCH v8a] bisect: fix 'git bisect run' so that it works with alternate --update-ref","startedAt":"2011-07-31T13:46:43Z","lastAt":"2011-07-31T13:46:43Z","messageCount":1,"participants":["Jon Seymour"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"172449","messageId":"1312120003-26321-1-git-send-email-jon.seymour@gmail.com","threadId":"27969","inReplyTo":null,"subject":"[PATCH v8a] bisect: fix 'git bisect run' so that it works with alternate --update-ref","fromName":"Jon Seymour","fromEmail":"jon.seymour@gmail.com","sentAt":"2011-07-31T13:46:43Z","receivedAt":"2011-07-31T13:46:43Z","isPatch":true,"sender":{"key":"jon.seymour@gmail.com","avatar":"https://avatars.githubusercontent.com/u/207131?v=4"},"body":"An additional patch for the v8 series that ensures that 'git bisect run'\nrespects .git/BISECT_UPDATE_REF.\n\nSigned-off-by: Jon Seymour <jon.seymour@gmail.com>\n---\n git-bisect.sh               |    5 +++--\n t/t6030-bisect-porcelain.sh |   15 +++++++++++++++\n 2 files changed, 18 insertions(+), 2 deletions(-)\n\ndiff --git a/git-bisect.sh b/git-bisect.sh\nindex ec70cd2..126d698 100755\n--- a/git-bisect.sh\n+++ b/git-bisect.sh\n@@ -230,8 +230,9 @@ bisect_state() {\n \t0,*)\n \t\tdie \"$(gettext \"Please call 'bisect_state' with at least one argument.\")\" ;;\n \t1,bad|1,good|1,skip)\n-\t\trev=$(git rev-parse --verify HEAD) ||\n-\t\t\tdie \"$(gettext \"Bad rev input: HEAD\")\"\n+\t\tref=${BISECT_UPDATE_REF:-HEAD}\n+\t\trev=$(git rev-parse --verify \"$ref\") ||\n+\t\t\tdie \"$(gettext \"Bad rev input: $ref\")\"\n \t\tbisect_write \"$state\" \"$rev\"\n \t\tcheck_expected_revs \"$rev\" ;;\n \t2,bad|*,good|*,skip)\ndiff --git a/t/t6030-bisect-porcelain.sh b/t/t6030-bisect-porcelain.sh\nindex fa4366f..40f7a76 100755\n--- a/t/t6030-bisect-porcelain.sh\n+++ b/t/t6030-bisect-porcelain.sh\n@@ -736,4 +736,19 @@ test \\$rc -eq 0;' &&\n \tgit bisect reset\n \"\n \n+test_expect_success 'bisect: demonstrate identification of damage boundary using alternate reference' \"\n+\tgit bisect reset &&\n+\tgit checkout broken &&\n+\tgit bisect start broken master --no-checkout --update-ref=CURSOR &&\n+\tgit bisect run eval '\n+rc=1;\n+if git rev-list --objects CURSOR >tmp.$$; then\n+   git pack-objects --stdout >/dev/null < tmp.$$ && rc=0;\n+fi;\n+rm tmp.$$;\n+test \\$rc -eq 0;' &&\n+\tcheck_same BROKEN_HASH6 bisect/bad &&\n+\tgit bisect reset\n+\"\n+\n test_done\n-- \n1.7.6.389.gccb79d.dirty\n"}]}