]> git.ipfire.org Git - thirdparty/git.git/blobdiff - git-bisect.sh
reftable: drop stray printf in readwrite_test
[thirdparty/git.git] / git-bisect.sh
index 6a7afaea8da09fa3fb3670d1a688421fbf152747..405cf76f2a3d94d5cb03b50d59ff729b745842ad 100755 (executable)
@@ -34,94 +34,9 @@ Please use "git help bisect" to get the full man page.'
 OPTIONS_SPEC=
 . git-sh-setup
 
-_x40='[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]'
-_x40="$_x40$_x40$_x40$_x40$_x40$_x40$_x40$_x40"
 TERM_BAD=bad
 TERM_GOOD=good
 
-bisect_visualize() {
-       git bisect--helper --bisect-next-check $TERM_GOOD $TERM_BAD fail || exit
-
-       if test $# = 0
-       then
-               if test -n "${DISPLAY+set}${SESSIONNAME+set}${MSYSTEM+set}${SECURITYSESSIONID+set}" &&
-                       type gitk >/dev/null 2>&1
-               then
-                       set gitk
-               else
-                       set git log
-               fi
-       else
-               case "$1" in
-               git*|tig) ;;
-               -*)     set git log "$@" ;;
-               *)      set git "$@" ;;
-               esac
-       fi
-
-       eval '"$@"' --bisect -- $(cat "$GIT_DIR/BISECT_NAMES")
-}
-
-bisect_run () {
-       git bisect--helper --bisect-next-check $TERM_GOOD $TERM_BAD fail || exit
-
-       test -n "$*" || die "$(gettext "bisect run failed: no command provided.")"
-
-       while true
-       do
-               command="$@"
-               eval_gettextln "running \$command"
-               "$@"
-               res=$?
-
-               # Check for really bad run error.
-               if [ $res -lt 0 -o $res -ge 128 ]
-               then
-                       eval_gettextln "bisect run failed:
-exit code \$res from '\$command' is < 0 or >= 128" >&2
-                       exit $res
-               fi
-
-               # Find current state depending on run success or failure.
-               # A special exit code of 125 means cannot test.
-               if [ $res -eq 125 ]
-               then
-                       state='skip'
-               elif [ $res -gt 0 ]
-               then
-                       state="$TERM_BAD"
-               else
-                       state="$TERM_GOOD"
-               fi
-
-               git bisect--helper --bisect-state $state >"$GIT_DIR/BISECT_RUN"
-               res=$?
-
-               cat "$GIT_DIR/BISECT_RUN"
-
-               if sane_grep "first $TERM_BAD commit could be any of" "$GIT_DIR/BISECT_RUN" \
-                       >/dev/null
-               then
-                       gettextln "bisect run cannot continue any more" >&2
-                       exit $res
-               fi
-
-               if [ $res -ne 0 ]
-               then
-                       eval_gettextln "bisect run failed:
-'bisect-state \$state' exited with error code \$res" >&2
-                       exit $res
-               fi
-
-               if sane_grep "is the first $TERM_BAD commit" "$GIT_DIR/BISECT_RUN" >/dev/null
-               then
-                       gettextln "bisect run success"
-                       exit 0;
-               fi
-
-       done
-}
-
 get_terms () {
        if test -s "$GIT_DIR/BISECT_TERMS"
        then
@@ -152,7 +67,7 @@ case "$#" in
                # Not sure we want "next" at the UI level anymore.
                git bisect--helper --bisect-next "$@" || exit ;;
        visualize|view)
-               bisect_visualize "$@" ;;
+               git bisect--helper --bisect-visualize "$@" || exit;;
        reset)
                git bisect--helper --bisect-reset "$@" ;;
        replay)
@@ -160,7 +75,7 @@ case "$#" in
        log)
                git bisect--helper --bisect-log || exit ;;
        run)
-               bisect_run "$@" ;;
+               git bisect--helper --bisect-run "$@" || exit;;
        terms)
                git bisect--helper --bisect-terms "$@" || exit;;
        *)