3 USAGE
='[help|start|bad|good|new|old|terms|skip|next|reset|visualize|view|replay|log|run]'
4 LONG_USAGE
='git bisect help
5 print this long help message.
6 git bisect start [--term-{new,bad}=<term> --term-{old,good}=<term>]
7 [--no-checkout] [--first-parent] [<bad> [<good>...]] [--] [<pathspec>...]
8 reset bisect state and start bisection.
9 git bisect (bad|new) [<rev>]
10 mark <rev> a known-bad revision/
11 a revision after change in a given property.
12 git bisect (good|old) [<rev>...]
13 mark <rev>... known-good revisions/
14 revisions before change in a given property.
15 git bisect terms [--term-good | --term-bad]
16 show the terms used for old and new commits (default: bad, good)
17 git bisect skip [(<rev>|<range>)...]
18 mark <rev>... untestable revisions.
20 find next bisection to test and check it out.
21 git bisect reset [<commit>]
22 finish bisection search and go back to commit.
23 git bisect (visualize|view)
24 show bisect status in gitk.
25 git bisect replay <logfile>
29 git bisect run <cmd>...
30 use <cmd>... to automatically bisect.
32 Please use "git help bisect" to get the full man page.'
37 _x40
='[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]'
38 _x40
="$_x40$_x40$_x40$_x40$_x40$_x40$_x40$_x40"
48 revs
=$
(git rev-list
"$arg") || die
"$(eval_gettext "Bad
rev input
: \
$arg")" ;;
50 revs
=$
(git rev-parse
--sq-quote "$arg") ;;
54 eval git bisect--helper
--bisect-state 'skip' $all
58 git bisect--helper
--bisect-next-check $TERM_GOOD $TERM_BAD fail ||
exit
62 if test -n "${DISPLAY+set}${SESSIONNAME+set}${MSYSTEM+set}${SECURITYSESSIONID+set}" &&
63 type gitk
>/dev
/null
2>&1
72 -*) set git log
"$@" ;;
77 eval '"$@"' --bisect -- $
(cat "$GIT_DIR/BISECT_NAMES")
82 test "$#" -eq 1 || die
"$(gettext "No logfile given
")"
83 test -r "$file" || die
"$(eval_gettext "cannot
read \
$file for replaying
")"
84 git bisect--helper
--bisect-reset ||
exit
85 oIFS
="$IFS" IFS
="$IFS$(printf '\015')"
86 while read git bisect
command rev tail
88 test "$git $bisect" = "git bisect" ||
test "$git" = "git-bisect" ||
continue
89 if test "$git" = "git-bisect"
95 git bisect--helper
--check-and-set-terms "$command" "$TERM_GOOD" "$TERM_BAD" ||
exit
99 eval "git bisect--helper --bisect-start $rev $tail" ;;
100 "$TERM_GOOD"|
"$TERM_BAD"|skip
)
101 git bisect--helper
--bisect-write "$command" "$rev" "$TERM_GOOD" "$TERM_BAD" ||
exit;;
103 git bisect--helper
--bisect-terms $rev ||
exit;;
105 die
"$(gettext "?? what are you talking about?
")" ;;
109 git bisect--helper
--bisect-auto-next ||
exit
113 git bisect--helper
--bisect-next-check $TERM_GOOD $TERM_BAD fail ||
exit
115 test -n "$*" || die
"$(gettext "bisect run failed
: no
command provided.
")"
120 eval_gettextln
"running \$command"
124 # Check for really bad run error.
125 if [ $res -lt 0 -o $res -ge 128 ]
127 eval_gettextln
"bisect run failed:
128 exit code \$res from '\$command' is < 0 or >= 128" >&2
132 # Find current state depending on run success or failure.
133 # A special exit code of 125 means cannot test.
144 git bisect--helper
--bisect-state $state >"$GIT_DIR/BISECT_RUN"
147 cat "$GIT_DIR/BISECT_RUN"
149 if sane_grep
"first $TERM_BAD commit could be any of" "$GIT_DIR/BISECT_RUN" \
152 gettextln
"bisect run cannot continue any more" >&2
158 eval_gettextln
"bisect run failed:
159 'bisect-state \$state' exited with error code \$res" >&2
163 if sane_grep
"is the first $TERM_BAD commit" "$GIT_DIR/BISECT_RUN" >/dev
/null
165 gettextln
"bisect run success"
173 test -s "$GIT_DIR/BISECT_LOG" || die
"$(gettext "We are not bisecting.
")"
174 cat "$GIT_DIR/BISECT_LOG"
178 if test -s "$GIT_DIR/BISECT_TERMS"
183 } <"$GIT_DIR/BISECT_TERMS"
198 git bisect--helper
--bisect-start "$@" ;;
199 bad|good|new|old|
"$TERM_BAD"|
"$TERM_GOOD")
200 git bisect--helper
--bisect-state "$cmd" "$@" ;;
204 # Not sure we want "next" at the UI level anymore.
205 git bisect--helper
--bisect-next "$@" ||
exit ;;
207 bisect_visualize
"$@" ;;
209 git bisect--helper
--bisect-reset "$@" ;;
211 bisect_replay
"$@" ;;
217 git bisect--helper
--bisect-terms "$@" ||
exit;;