Update draft release notes to 1.8.4
[gitweb.git] / git-bisect.sh
index 99efbe884528ffa730d6c0297e20d9de93d5ad9e..9f064b6f4f0c209a0315538e48049c2d013316df 100755 (executable)
@@ -311,7 +311,23 @@ bisect_next() {
        res=$?
 
        # Check if we should exit because bisection is finished
-       test $res -eq 10 && exit 0
+       if test $res -eq 10
+       then
+               bad_rev=$(git show-ref --hash --verify refs/bisect/bad)
+               bad_commit=$(git show-branch $bad_rev)
+               echo "# first bad commit: $bad_commit" >>"$GIT_DIR/BISECT_LOG"
+               exit 0
+       elif test $res -eq 2
+       then
+               echo "# only skipped commits left to test" >>"$GIT_DIR/BISECT_LOG"
+               good_revs=$(git for-each-ref --format="%(objectname)" "refs/bisect/good-*")
+               for skipped in $(git rev-list refs/bisect/bad --not $good_revs)
+               do
+                       skipped_commit=$(git show-branch $skipped)
+                       echo "# possible first bad commit: $skipped_commit" >>"$GIT_DIR/BISECT_LOG"
+               done
+               exit $res
+       fi
 
        # Check for an error in the bisection process
        test $res -ne 0 && exit $res