{"thread":{"id":"16229","subject":"[PATCH 7/7 v3 updated] bisect: use \"--bisect-replace\" options when checking merge bases","startedAt":"2008-11-08T15:33:51Z","lastAt":"2008-11-08T15:33:51Z","messageCount":1,"participants":["Christian Couder"],"isPatch":true,"patchVersion":3,"patchTotal":7},"messages":[{"id":"95222","messageId":"20081108163351.5980a16c.chriscool@tuxfamily.org","threadId":"16229","inReplyTo":null,"subject":"[PATCH 7/7 v3 updated] bisect: use \"--bisect-replace\" options when checking merge bases","fromName":"Christian Couder","fromEmail":"chriscool@tuxfamily.org","sentAt":"2008-11-08T15:33:51Z","receivedAt":"2008-11-08T15:33:51Z","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>\n---\n git-bisect.sh             |    4 ++--\n t/t6035-bisect-replace.sh |   10 ++++++++++\n 2 files changed, 12 insertions(+), 2 deletions(-)\n\n\tThis is the same as [PATCH 7/7 v3] but with a test case\n\tadded.\n\ndiff --git a/git-bisect.sh b/git-bisect.sh\nindex 1daa81c..87e186f 100755\n--- a/git-bisect.sh\n+++ b/git-bisect.sh\n@@ -401,7 +401,7 @@ check_merge_bases() {\n \t_bad=\"$1\"\n \t_good=\"$2\"\n \t_skip=\"$3\"\n-\tfor _mb in $(git merge-base --all $_bad $_good)\n+\tfor _mb in $(git merge-base --all --bisect-replace $_bad $_good)\n \tdo\n \t\tif is_among \"$_mb\" \"$_good\"; then\n \t\t\tcontinue\n@@ -436,7 +436,7 @@ check_good_are_ancestors_of_bad() {\n \t# Bisecting with no good rev is ok\n \ttest -z \"$_good\" && return\n \n-\t_side=$(git rev-list $_good ^$_bad)\n+\t_side=$(git rev-list --bisect-replace $_good ^$_bad)\n \tif test -n \"$_side\"; then\n \t\t# Return if a checkout was done\n \t\tcheck_merge_bases \"$_bad\" \"$_good\" \"$_skip\" || return\ndiff --git a/t/t6035-bisect-replace.sh b/t/t6035-bisect-replace.sh\nindex 8fe7cc5..dabf1ae 100755\n--- a/t/t6035-bisect-replace.sh\n+++ b/t/t6035-bisect-replace.sh\n@@ -144,6 +144,16 @@ test_expect_success '\"git merge-base --bisect-replace\" works' '\n      test \"$hash\" = \"$HASH1\"\n '\n \n+test_expect_success 'git bisect works when starting on the replace branch' '\n+     git bisect start $HASH7 $HASHFIX3 &&\n+     test \"$(git rev-parse --verify HEAD)\" = \"$HASH5\" &&\n+     git bisect bad &&\n+     test \"$(git rev-parse --verify HEAD)\" = \"$HASHFIX4\" &&\n+     git bisect good > my_bisect_log.txt &&\n+     grep \"$HASH5 is first bad commit\" my_bisect_log.txt &&\n+     git bisect reset\n+'\n+\n #\n #\n test_done\n-- \n1.6.0.3.620.ge1fc\n"}]}