summaryrefslogtreecommitdiff
path: root/git-bisect.sh
diff options
context:
space:
mode:
authorLibravatar Matthieu Moy <Matthieu.Moy@imag.fr>2015-06-29 17:40:35 +0200
committerLibravatar Junio C Hamano <gitster@pobox.com>2015-08-03 11:42:43 -0700
commit06e6a745064c4f2f827177f6d92f4b9adb018200 (patch)
tree0a51b67594c0ab8dbf54000303dd306eaa94ce80 /git-bisect.sh
parentbisect: add 'git bisect terms' to view the current terms (diff)
downloadtgif-06e6a745064c4f2f827177f6d92f4b9adb018200.tar.xz
bisect: allow setting any user-specified in 'git bisect start'
This allows a natural user-interface when looking for any change in the code, not just regression. For example: git bisect start --term-old fast --term-new slow git bisect fast git bisect slow ... There were several proposed user-interfaces for this feature. This patch implements it as options to 'git bisect start' for the following reasons: * By construction, the terms will be valid for one and only one bisection. * Unlike positional arguments, using named options avoid having to remember an order. * We can combine user-defined terms and passing old/new commits as argument to "git bisect start". * The implementation is relatively simple. See previous discussions: http://mid.gmane.org/1435337896-20709-3-git-send-email-Matthieu.Moy@imag.fr 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.sh21
1 files changed, 20 insertions, 1 deletions
diff --git a/git-bisect.sh b/git-bisect.sh
index 89255a333f..5d1cb00d86 100755
--- a/git-bisect.sh
+++ b/git-bisect.sh
@@ -3,7 +3,8 @@
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>...]
+git bisect start [--term-{old,good}=<term> --term-{new,bad}=<term>]
+ [--no-checkout] [<bad> [<good>...]] [--] [<pathspec>...]
reset bisect state and start bisection.
git bisect (bad|new) [<rev>]
mark <rev> a known-bad revision/
@@ -99,6 +100,24 @@ bisect_start() {
--no-checkout)
mode=--no-checkout
shift ;;
+ --term-good|--term-old)
+ shift
+ must_write_terms=1
+ TERM_GOOD=$1
+ shift ;;
+ --term-good=*|--term-old=*)
+ must_write_terms=1
+ TERM_GOOD=${1#*=}
+ shift ;;
+ --term-bad|--term-new)
+ shift
+ must_write_terms=1
+ TERM_BAD=$1
+ shift ;;
+ --term-bad=*|--term-new=*)
+ must_write_terms=1
+ TERM_BAD=${1#*=}
+ shift ;;
--*)
die "$(eval_gettext "unrecognised option: '\$arg'")" ;;
*)