summaryrefslogtreecommitdiff
path: root/git-bisect.sh
blob: 405cf76f2a3d94d5cb03b50d59ff729b745842ad (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
#!/bin/sh

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-{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/
		a revision after change in a given property.
git bisect (good|old) [<rev>...]
	mark <rev>... known-good revisions/
		revisions before change in a given property.
git bisect terms [--term-good | --term-bad]
	show the terms used for old and new commits (default: bad, good)
git bisect skip [(<rev>|<range>)...]
	mark <rev>... untestable revisions.
git bisect next
	find next bisection to test and check it out.
git bisect reset [<commit>]
	finish bisection search and go back to commit.
git bisect (visualize|view)
	show bisect status in gitk.
git bisect replay <logfile>
	replay bisection log.
git bisect log
	show bisect log.
git bisect run <cmd>...
	use <cmd>... to automatically bisect.

Please use "git help bisect" to get the full man page.'

OPTIONS_SPEC=
. git-sh-setup

TERM_BAD=bad
TERM_GOOD=good

get_terms () {
	if test -s "$GIT_DIR/BISECT_TERMS"
	then
		{
		read TERM_BAD
		read TERM_GOOD
		} <"$GIT_DIR/BISECT_TERMS"
	fi
}

case "$#" in
0)
	usage ;;
*)
	cmd="$1"
	get_terms
	shift
	case "$cmd" in
	help)
		git bisect -h ;;
	start)
		git bisect--helper --bisect-start "$@" ;;
	bad|good|new|old|"$TERM_BAD"|"$TERM_GOOD")
		git bisect--helper --bisect-state "$cmd" "$@" ;;
	skip)
		git bisect--helper --bisect-skip "$@" || exit;;
	next)
		# Not sure we want "next" at the UI level anymore.
		git bisect--helper --bisect-next "$@" || exit ;;
	visualize|view)
		git bisect--helper --bisect-visualize "$@" || exit;;
	reset)
		git bisect--helper --bisect-reset "$@" ;;
	replay)
		git bisect--helper --bisect-replay "$@" || exit;;
	log)
		git bisect--helper --bisect-log || exit ;;
	run)
		git bisect--helper --bisect-run "$@" || exit;;
	terms)
		git bisect--helper --bisect-terms "$@" || exit;;
	*)
		usage ;;
	esac
esac