@matheusbsbs / matheus-bagliano / commits / 7334f06ce6
Fork 0

Do not fall back on vi on dumb terminals.

When TERM is set to 'dumb', do not start vi to edit the commit log message. Suggested by Amos Waterland. Signed-off-by: Junio C Hamano <junkio@cox.net>

Junio C Hamano committed Feb 4, 2006 at 22:10 UTC 7334f06ce6c53e161d1c183a5f93a23992b3c440
1 file changed +8
git-commit.sh
+8
@@ -207,6 +207,14 @@ then
207 fi
208 case "$no_edit" in
209 '')
210 + case "${VISUAL:-$EDITOR},$TERM" in
211 + ,dumb)
212 + echo >&2 "Terminal is dumb but no VISUAL nor EDITOR defined."
213 + echo >&2 "Please supply the commit log message using either"
214 + echo >&2 "-m or -F option. A boilerplate log message has"
215 + echo >&2 "been prepared in $GIT_DIR/COMMIT_EDITMSG"
216 + exit 1 ;;
217 + esac
218 ${VISUAL:-${EDITOR:-vi}} "$GIT_DIR/COMMIT_EDITMSG"
219 ;;
220 esac