summaryrefslogtreecommitdiff
path: root/git-bisect.sh
diff options
context:
space:
mode:
authorMatthieu Moy <Matthieu.Moy@imag.fr>2015-06-29 15:40:34 (GMT)
committerJunio C Hamano <gitster@pobox.com>2015-08-03 18:42:42 (GMT)
commit21b55e33695f47f3e2616d178ab1e06743bfef66 (patch)
tree2cea572519c22d16b55a59caa5d172c65579f4f6 /git-bisect.sh
parent21e5cfd8b3d35a702b19be6964b8809045dd6278 (diff)
downloadgit-21b55e33695f47f3e2616d178ab1e06743bfef66.zip
git-21b55e33695f47f3e2616d178ab1e06743bfef66.tar.gz
git-21b55e33695f47f3e2616d178ab1e06743bfef66.tar.bz2
bisect: add 'git bisect terms' to view the current terms
Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-bisect.sh')
-rwxr-xr-xgit-bisect.sh39
1 files changed, 38 insertions, 1 deletions
diff --git a/git-bisect.sh b/git-bisect.sh
index d78b043..89255a3 100755
--- a/git-bisect.sh
+++ b/git-bisect.sh
@@ -1,6 +1,6 @@
#!/bin/sh
-USAGE='[help|start|bad|good|new|old|skip|next|reset|visualize|replay|log|run]'
+USAGE='[help|start|bad|good|new|old|terms|skip|next|reset|visualize|replay|log|run]'
LONG_USAGE='git bisect help
print this long help message.
git bisect start [--no-checkout] [<bad> [<good>...]] [--] [<pathspec>...]
@@ -11,6 +11,8 @@ git bisect (bad|new) [<rev>]
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
@@ -453,6 +455,8 @@ bisect_replay () {
eval "$cmd" ;;
"$TERM_GOOD"|"$TERM_BAD"|skip)
bisect_write "$command" "$rev" ;;
+ terms)
+ bisect_terms $rev ;;
*)
die "$(gettext "?? what are you talking about?")" ;;
esac
@@ -606,6 +610,37 @@ bisect_voc () {
esac
}
+bisect_terms () {
+ get_terms
+ if ! test -s "$GIT_DIR/BISECT_TERMS"
+ then
+ die "$(gettext "no terms defined")"
+ fi
+ case "$#" in
+ 0)
+ gettextln "Your current terms are $TERM_GOOD for the old state
+and $TERM_BAD for the new state."
+ ;;
+ 1)
+ arg=$1
+ case "$arg" in
+ --term-good|--term-old)
+ printf '%s\n' "$TERM_GOOD"
+ ;;
+ --term-bad|--term-new)
+ printf '%s\n' "$TERM_BAD"
+ ;;
+ *)
+ die "$(eval_gettext "invalid argument \$arg for 'git bisect terms'.
+Supported options are: --term-good|--term-old and --term-bad|--term-new.")"
+ ;;
+ esac
+ ;;
+ *)
+ usage ;;
+ esac
+}
+
case "$#" in
0)
usage ;;
@@ -635,6 +670,8 @@ case "$#" in
bisect_log ;;
run)
bisect_run "$@" ;;
+ terms)
+ bisect_terms "$@" ;;
*)
usage ;;
esac