]> git.ipfire.org Git - thirdparty/git.git/blobdiff - git-bisect.sh
submodules: fix of regression on fetching of non-init subsub-repo
[thirdparty/git.git] / git-bisect.sh
index eefbee3e78f50ba1de6497fa8051abcde92c39ec..ea7e684ebb55481b8118adaab6dd2324cf7bf3e8 100755 (executable)
@@ -3,8 +3,8 @@
 USAGE='[help|start|bad|good|new|old|terms|skip|next|reset|visualize|view|replay|log|run]'
 LONG_USAGE='git bisect help
        print this long help message.
-git bisect start [--term-{old,good}=<term> --term-{new,bad}=<term>]
-                [--no-checkout] [<bad> [<good>...]] [--] [<pathspec>...]
+git bisect start [--term-{new,bad}=<term> --term-{old,good}=<term>]
+                [--no-checkout] [--first-parent] [<bad> [<good>...]] [--] [<pathspec>...]
        reset bisect state and start bisection.
 git bisect (bad|new) [<rev>]
        mark <rev> a known-bad revision/
@@ -65,8 +65,7 @@ bisect_start() {
        #
        # Check if we can proceed to the next bisect state.
        #
-       get_terms
-       bisect_auto_next
+       git bisect--helper --bisect-auto-next || exit
 
        trap '-' 0
 }
@@ -119,45 +118,7 @@ bisect_state() {
        *)
                usage ;;
        esac
-       bisect_auto_next
-}
-
-bisect_auto_next() {
-       git bisect--helper --bisect-next-check $TERM_GOOD $TERM_BAD && bisect_next || :
-}
-
-bisect_next() {
-       case "$#" in 0) ;; *) usage ;; esac
-       git bisect--helper --bisect-autostart || exit
-       git bisect--helper --bisect-next-check $TERM_GOOD $TERM_BAD $TERM_GOOD|| exit
-
-       # Perform all bisection computation, display and checkout
-       git bisect--helper --next-all
-       res=$?
-
-       # Check if we should exit because bisection is finished
-       if test $res -eq 10
-       then
-               bad_rev=$(git show-ref --hash --verify refs/bisect/$TERM_BAD)
-               bad_commit=$(git show-branch $bad_rev)
-               echo "# first $TERM_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/$TERM_GOOD-*")
-               for skipped in $(git rev-list refs/bisect/$TERM_BAD --not $good_revs)
-               do
-                       skipped_commit=$(git show-branch $skipped)
-                       echo "# possible first $TERM_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
-
-       return 0
+       git bisect--helper --bisect-auto-next
 }
 
 bisect_visualize() {
@@ -213,7 +174,7 @@ bisect_replay () {
                esac
        done <"$file"
        IFS="$oIFS"
-       bisect_auto_next
+       git bisect--helper --bisect-auto-next || exit
 }
 
 bisect_run () {
@@ -310,7 +271,7 @@ case "$#" in
                bisect_skip "$@" ;;
        next)
                # Not sure we want "next" at the UI level anymore.
-               bisect_next "$@" ;;
+               git bisect--helper --bisect-next "$@" || exit ;;
        visualize|view)
                bisect_visualize "$@" ;;
        reset)