]> git.ipfire.org Git - thirdparty/git.git/blame - git-bisect.sh
Git 2.34.8
[thirdparty/git.git] / git-bisect.sh
CommitLineData
8cc6a083 1#!/bin/sh
d025524d 2
dbc349bb 3USAGE='[help|start|bad|good|new|old|terms|skip|next|reset|visualize|view|replay|log|run]'
243a60fb 4LONG_USAGE='git bisect help
6021be86 5 print this long help message.
ef4d9f8a 6git bisect start [--term-{new,bad}=<term> --term-{old,good}=<term>]
6028f5f6 7 [--no-checkout] [--first-parent] [<bad> [<good>...]] [--] [<pathspec>...]
6021be86 8 reset bisect state and start bisection.
21e5cfd8
AD
9git bisect (bad|new) [<rev>]
10 mark <rev> a known-bad revision/
11 a revision after change in a given property.
12git bisect (good|old) [<rev>...]
13 mark <rev>... known-good revisions/
14 revisions before change in a given property.
21b55e33
MM
15git bisect terms [--term-good | --term-bad]
16 show the terms used for old and new commits (default: bad, good)
5413812f 17git bisect skip [(<rev>|<range>)...]
6021be86 18 mark <rev>... untestable revisions.
38a47fd6 19git bisect next
6021be86 20 find next bisection to test and check it out.
6b87ce23 21git bisect reset [<commit>]
6021be86 22 finish bisection search and go back to commit.
dbc349bb 23git bisect (visualize|view)
6021be86 24 show bisect status in gitk.
38a47fd6 25git bisect replay <logfile>
6021be86 26 replay bisection log.
38a47fd6 27git bisect log
6021be86 28 show bisect log.
38a47fd6 29git bisect run <cmd>...
6021be86 30 use <cmd>... to automatically bisect.
243a60fb
CC
31
32Please use "git help bisect" to get the full man page.'
d025524d 33
8f321a39 34OPTIONS_SPEC=
ae2b0f15 35. git-sh-setup
8cc6a083 36
43f9d9f3
AD
37TERM_BAD=bad
38TERM_GOOD=good
ce32660e 39
cb46d630
AD
40get_terms () {
41 if test -s "$GIT_DIR/BISECT_TERMS"
42 then
43 {
44 read TERM_BAD
45 read TERM_GOOD
46 } <"$GIT_DIR/BISECT_TERMS"
47 fi
48}
49
8cc6a083
LT
50case "$#" in
510)
6021be86 52 usage ;;
8cc6a083 53*)
6021be86 54 cmd="$1"
cb46d630 55 get_terms
6021be86
JS
56 shift
57 case "$cmd" in
58 help)
59 git bisect -h ;;
60 start)
88ad372f 61 git bisect--helper --bisect-start "$@" ;;
21e5cfd8 62 bad|good|new|old|"$TERM_BAD"|"$TERM_GOOD")
27257bc4 63 git bisect--helper --bisect-state "$cmd" "$@" ;;
6021be86 64 skip)
e4c7b337 65 git bisect--helper --bisect-skip "$@" || exit;;
6021be86
JS
66 next)
67 # Not sure we want "next" at the UI level anymore.
517ecb31 68 git bisect--helper --bisect-next "$@" || exit ;;
6021be86 69 visualize|view)
5e1f28d2 70 git bisect--helper --bisect-visualize "$@" || exit;;
6021be86 71 reset)
5e82c3dd 72 git bisect--helper --bisect-reset "$@" ;;
6021be86 73 replay)
2b1fd947 74 git bisect--helper --bisect-replay "$@" || exit;;
6021be86 75 log)
97d5ba6a 76 git bisect--helper --bisect-log || exit ;;
6021be86 77 run)
d1bbbe45 78 git bisect--helper --bisect-run "$@" || exit;;
21b55e33 79 terms)
450ebb73 80 git bisect--helper --bisect-terms "$@" || exit;;
6021be86
JS
81 *)
82 usage ;;
83 esac
8cc6a083 84esac