]> asedeno.scripts.mit.edu Git - git.git/blobdiff - git-bisect.sh
filter-branch.sh: remove temporary directory on failure
[git.git] / git-bisect.sh
index 6f20a297a5f8812935e79723a52b95306bc22306..5385249890698632dedcaf8dda03d865f66abca9 100755 (executable)
@@ -22,6 +22,7 @@ git bisect log
 git bisect run <cmd>...
         use <cmd>... to automatically bisect.'
 
+OPTIONS_SPEC=
 . git-sh-setup
 require_work_tree
 
@@ -323,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() {
@@ -448,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 "$@" ;;