summaryrefslogtreecommitdiff
path: root/git-bisect.sh
diff options
context:
space:
mode:
authorAntoine Delaite <antoine.delaite@ensimag.grenoble-inp.fr>2015-06-29 15:40:33 (GMT)
committerJunio C Hamano <gitster@pobox.com>2015-08-03 18:42:42 (GMT)
commit21e5cfd8b3d35a702b19be6964b8809045dd6278 (patch)
treeaec6f77b78dafb8483929b853eab183a6961eff2 /git-bisect.sh
parentfe67687bb1b38cbbdca4339caf14136b33e04783 (diff)
downloadgit-21e5cfd8b3d35a702b19be6964b8809045dd6278.zip
git-21e5cfd8b3d35a702b19be6964b8809045dd6278.tar.gz
git-21e5cfd8b3d35a702b19be6964b8809045dd6278.tar.bz2
bisect: add the terms old/new
When not looking for a regression during a bisect but for a fix or a change in another given property, it can be confusing to use 'good' and 'bad'. This patch introduce `git bisect new` and `git bisect old` as an alternative to 'bad' and good': the commits which have a certain property must be marked as `new` and the ones which do not as `old`. The output will be the first commit after the change in the property. During a new/old bisect session you cannot use bad/good commands and vice-versa. Some commands are still not available for old/new: * git rev-list --bisect does not treat the revs/bisect/new and revs/bisect/old-SHA1 files. Old discussions: - http://thread.gmane.org/gmane.comp.version-control.git/86063 introduced bisect fix unfixed to find fix. - http://thread.gmane.org/gmane.comp.version-control.git/182398 discussion around bisect yes/no or old/new. - http://thread.gmane.org/gmane.comp.version-control.git/199758 last discussion and reviews New discussions: - http://thread.gmane.org/gmane.comp.version-control.git/271320 ( v2 1/7-4/7 ) - http://comments.gmane.org/gmane.comp.version-control.git/271343 ( v2 5/7-7/7 ) Signed-off-by: Antoine Delaite <antoine.delaite@ensimag.grenoble-inp.fr> Signed-off-by: Louis Stuber <stuberl@ensimag.grenoble-inp.fr> Signed-off-by: Valentin Duperray <Valentin.Duperray@ensimag.imag.fr> Signed-off-by: Franck Jonas <Franck.Jonas@ensimag.imag.fr> Signed-off-by: Lucien Kong <Lucien.Kong@ensimag.imag.fr> Signed-off-by: Thomas Nguy <Thomas.Nguy@ensimag.imag.fr> Signed-off-by: Huynh Khoi Nguyen Nguyen <Huynh-Khoi-Nguyen.Nguyen@ensimag.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.sh26
1 files changed, 17 insertions, 9 deletions
diff --git a/git-bisect.sh b/git-bisect.sh
index 761ca6c..d78b043 100755
--- a/git-bisect.sh
+++ b/git-bisect.sh
@@ -1,14 +1,16 @@
#!/bin/sh
-USAGE='[help|start|bad|good|skip|next|reset|visualize|replay|log|run]'
+USAGE='[help|start|bad|good|new|old|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>...]
reset bisect state and start bisection.
-git bisect bad [<rev>]
- mark <rev> a known-bad revision.
-git bisect good [<rev>...]
- mark <rev>... known-good revisions.
+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 skip [(<rev>|<range>)...]
mark <rev>... untestable revisions.
git bisect next
@@ -294,7 +296,7 @@ bisect_next_check() {
false
;;
t,,"$TERM_GOOD")
- # have bad but not good. we could bisect although
+ # have bad (or new) but not good (or old). we could bisect although
# this is less optimum.
eval_gettextln "Warning: bisecting only with a \$TERM_BAD commit." >&2
if test -t 0
@@ -587,14 +589,20 @@ check_and_set_terms () {
write_terms bad good
fi
;;
+ new|old)
+ if ! test -s "$GIT_DIR/BISECT_TERMS"
+ then
+ write_terms new old
+ fi
+ ;;
esac ;;
esac
}
bisect_voc () {
case "$1" in
- bad) echo "bad" ;;
- good) echo "good" ;;
+ bad) echo "bad|new" ;;
+ good) echo "good|old" ;;
esac
}
@@ -610,7 +618,7 @@ case "$#" in
git bisect -h ;;
start)
bisect_start "$@" ;;
- bad|good|"$TERM_BAD"|"$TERM_GOOD")
+ bad|good|new|old|"$TERM_BAD"|"$TERM_GOOD")
bisect_state "$cmd" "$@" ;;
skip)
bisect_skip "$@" ;;