git-prompt.sh: don't put unsanitized branch names in $PS1
[gitweb.git] / git-bisect.sh
index c58eea7cb6b34d69e812d2bac8f514272f679beb..73b4c14d4f631b811a20392684a87c6b97daedc7 100755 (executable)
@@ -137,7 +137,7 @@ bisect_start() {
                        # cogito usage, and cogito users should understand
                        # it relates to cg-seek.
                        [ -s "$GIT_DIR/head-name" ] &&
-                               die "$(gettext "won't bisect on seeked tree")"
+                               die "$(gettext "won't bisect on cg-seek'ed tree")"
                        start_head="${head#refs/heads/}"
                        ;;
                *)
@@ -317,6 +317,16 @@ bisect_next() {
                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