summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 78d553b)
raw | patch | inline | side by side (parent: 78d553b)
author | René Scharfe <rene.scharfe@lsrfire.ath.cx> | |
Mon, 23 Nov 2009 23:29:17 +0000 (00:29 +0100) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Mon, 23 Nov 2009 23:38:04 +0000 (15:38 -0800) |
Use a case statement instead of calling grep to find out if the editor's
name contains the string "vim". Remove the check for emacs, as this
branch did the same as the default one anyway.
Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
name contains the string "vim". Remove the check for emacs, as this
branch did the same as the default one anyway.
Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
git-mergetool--lib.sh | patch | blob | history |
diff --git a/git-mergetool--lib.sh b/git-mergetool--lib.sh
index bfb01f7842e6192e0b3fbc0e3f2ab96269578289..334af7c3478bd6e4fa3f29e360b6be4fbaf6f8cb 100644 (file)
--- a/git-mergetool--lib.sh
+++ b/git-mergetool--lib.sh
fi
tools="$tools gvimdiff diffuse ecmerge 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.