summaryrefslogtreecommitdiff
path: root/git-bisect.sh
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2011-03-21 09:14:22 -0400
committerJunio C Hamano <gitster@pobox.com>2011-03-21 10:23:45 -0700
commitc4e4644e17e0fad4a6ffedba22b739cf1b1ac3fc (patch)
tree05d3b828981663e8aeb13c537d638aee88ac350f /git-bisect.sh
parentd98f24cd9d8d8ee20b65d22ec6b78da04b48de85 (diff)
downloadgit-c4e4644e17e0fad4a6ffedba22b739cf1b1ac3fc.tar.gz
bisect: visualize with git-log if gitk is unavailable
If gitk is not available in the PATH, bisect ends up exiting with the shell's 127 error code, confusing the git wrapper into thinking that bisect is not a git command. We already fallback to git-log if there doesn't seem to be a graphical display available. We should do the same if gitk is not available in our PATH at all. This not only fixes the ugly error message, but is a much more sensible default than failing to show the user anything. Reported by Maxin John. Tested-by: Maxin B. John <maxin@maxinbjohn.info> Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-bisect.sh')
-rwxr-xr-xgit-bisect.sh10
1 files changed, 6 insertions, 4 deletions
diff --git a/git-bisect.sh b/git-bisect.sh
index c21e33c8d1..415a8d04cc 100755
--- a/git-bisect.sh
+++ b/git-bisect.sh
@@ -288,10 +288,12 @@ bisect_visualize() {
if test $# = 0
then
- case "${DISPLAY+set}${SESSIONNAME+set}${MSYSTEM+set}${SECURITYSESSIONID+set}" in
- '') set git log ;;
- set*) set gitk ;;
- esac
+ if test -n "${DISPLAY+set}${SESSIONNAME+set}${MSYSTEM+set}${SECURITYSESSIONID+set}" &&
+ type gitk >/dev/null 2>&1; then
+ set gitk
+ else
+ set git log
+ fi
else
case "$1" in
git*|tig) ;;