summaryrefslogtreecommitdiff
path: root/git-commit.sh
diff options
context:
space:
mode:
authorAdam Roben <aroben@apple.com>2007-07-19 22:09:35 -0700
committerJunio C Hamano <gitster@pobox.com>2007-07-20 00:46:34 -0700
commitef0c2abf3e5061f891b7f07953ef3b0695f52c89 (patch)
treea48c4cbea302eb1d41bc1d798c1e85bcc892ea8a /git-commit.sh
parenta7738c77f1f17ced885ce96e986b948a0b256452 (diff)
downloadgit-ef0c2abf3e5061f891b7f07953ef3b0695f52c89.tar.gz
Add GIT_EDITOR environment and core.editor configuration variables
These variables let you specify an editor that will be launched in preference to the EDITOR and VISUAL environment variables. The order of preference is GIT_EDITOR, core.editor, EDITOR, VISUAL. [jc: added a test and config variable documentation] Signed-off-by: Adam Roben <aroben@apple.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-commit.sh')
-rwxr-xr-xgit-commit.sh11
1 files changed, 1 insertions, 10 deletions
diff --git a/git-commit.sh b/git-commit.sh
index 3f3de1729e..92749df1e7 100755
--- a/git-commit.sh
+++ b/git-commit.sh
@@ -544,18 +544,9 @@ fi
case "$no_edit" in
'')
- case "${VISUAL:-$EDITOR},$TERM" in
- ,dumb)
- echo >&2 "Terminal is dumb but no VISUAL nor EDITOR defined."
- echo >&2 "Please supply the commit log message using either"
- echo >&2 "-m or -F option. A boilerplate log message has"
- echo >&2 "been prepared in $GIT_DIR/COMMIT_EDITMSG"
- exit 1
- ;;
- esac
git-var GIT_AUTHOR_IDENT > /dev/null || die
git-var GIT_COMMITTER_IDENT > /dev/null || die
- ${VISUAL:-${EDITOR:-vi}} "$GIT_DIR/COMMIT_EDITMSG"
+ git_editor "$GIT_DIR/COMMIT_EDITMSG"
;;
esac