X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=git-mergetool--lib.sh;h=5b6278572a48569a806a5a976cdd08eb7c117fb7;hb=6ceeaee7ea5bb754c76ce93c5b289f72d69fdb92;hp=f7c571e73cdf471148b606242066536361ac7c3d;hpb=7dacc6c0681203bb24b74c7b3318b1e6d5d16ee5;p=git.git diff --git a/git-mergetool--lib.sh b/git-mergetool--lib.sh index f7c571e73..5b6278572 100644 --- a/git-mergetool--lib.sh +++ b/git-mergetool--lib.sh @@ -338,15 +338,14 @@ guess_merge_tool () { fi tools="$tools gvimdiff diffuse ecmerge p4merge araxis" fi - if echo "${VISUAL:-$EDITOR}" | grep emacs > /dev/null 2>&1; then - # $EDITOR is emacs so add emerge as a candidate - tools="$tools emerge vimdiff" - elif echo "${VISUAL:-$EDITOR}" | grep vim > /dev/null 2>&1; then - # $EDITOR is vim so add vimdiff as a candidate + case "${VISUAL:-$EDITOR}" in + *vim*) tools="$tools vimdiff emerge" - else + ;; + *) tools="$tools emerge vimdiff" - fi + ;; + esac echo >&2 "merge tool candidates: $tools" # Loop over each candidate and stop when a valid merge tool is found.