Browse Source

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>
maint
Jeff King 14 years ago committed by Junio C Hamano
parent
commit
c4e4644e17
  1. 10
      git-bisect.sh

10
git-bisect.sh

@ -288,10 +288,12 @@ bisect_visualize() {


if test $# = 0 if test $# = 0
then then
case "${DISPLAY+set}${SESSIONNAME+set}${MSYSTEM+set}${SECURITYSESSIONID+set}" in if test -n "${DISPLAY+set}${SESSIONNAME+set}${MSYSTEM+set}${SECURITYSESSIONID+set}" &&
'') set git log ;; type gitk >/dev/null 2>&1; then
set*) set gitk ;; set gitk
esac else
set git log
fi
else else
case "$1" in case "$1" in
git*|tig) ;; git*|tig) ;;

Loading…
Cancel
Save