aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Documentation/git-bisect.txt11
-rwxr-xr-xgit-bisect.sh19
2 files changed, 27 insertions, 3 deletions
diff --git a/Documentation/git-bisect.txt b/Documentation/git-bisect.txt
index 4795349c1..8b9d61a8a 100644
--- a/Documentation/git-bisect.txt
+++ b/Documentation/git-bisect.txt
@@ -92,7 +92,16 @@ During the bisection process, you can say
$ git bisect visualize
------------
-to see the currently remaining suspects in `gitk`.
+to see the currently remaining suspects in `gitk`. `visualize` is a bit
+too long to type and `view` is provided as a synonym.
+
+If `DISPLAY` environment variable is not set, `git log` is used
+instead. You can even give command line options such as `-p` and
+`--stat`.
+
+------------
+$ git bisect view --stat
+------------
Bisect log and bisect replay
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
diff --git a/git-bisect.sh b/git-bisect.sh
index 7a6521ec3..538524989 100755
--- a/git-bisect.sh
+++ b/git-bisect.sh
@@ -324,8 +324,23 @@ bisect_next() {
bisect_visualize() {
bisect_next_check fail
+
+ if test $# = 0
+ then
+ case "${DISPLAY+set}" in
+ '') set git log ;;
+ set) set gitk ;;
+ esac
+ else
+ case "$1" in
+ git*|tig) ;;
+ -*) set git log "$@" ;;
+ *) set git "$@" ;;
+ esac
+ fi
+
not=$(git for-each-ref --format='%(refname)' "refs/bisect/good-*")
- eval gitk refs/bisect/bad --not $not -- $(cat "$GIT_DIR/BISECT_NAMES")
+ eval '"$@"' refs/bisect/bad --not $not -- $(cat "$GIT_DIR/BISECT_NAMES")
}
bisect_reset() {
@@ -449,7 +464,7 @@ case "$#" in
next)
# Not sure we want "next" at the UI level anymore.
bisect_next "$@" ;;
- visualize)
+ visualize|view)
bisect_visualize "$@" ;;
reset)
bisect_reset "$@" ;;