From: Amos Waterland <apw@us.ibm.com>
To: junkio@cox.net
Cc: git@vger.kernel.org, boutcher@cs.umn.edu
Subject: [PATCH] do not open editor in dumb terminal
Date: Fri, 3 Feb 2006 06:41:33 -0500 [thread overview]
Message-ID: <20060203114133.GA11499@kvasir.watson.ibm.com> (raw)
Many people run git from a shell in emacs (obtained by M-x shell). When
they try to do a commit without specifying a log message on the command
line with -m, git opens vi inside emacs, with unpleasant results. I
think the right answer is to just refuse to open an editor in any dumb
terminal.
Signed-off-by: Amos Waterland <apw@us.ibm.com>
Cc: Dave C Boutcher <boutcher@cs.umn.edu>
---
git-commit.sh | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
c0ee93460521c1cbf9d3fe86a08b41295a79ebb1
diff --git a/git-commit.sh b/git-commit.sh
index 193feeb..fef8f96 100755
--- a/git-commit.sh
+++ b/git-commit.sh
@@ -207,6 +207,12 @@ then
fi
case "$no_edit" in
'')
+ if [ "$TERM" = "dumb" ]; then
+ printf "%s: %s: %s\n" "git-commit" \
+ "cannot open editor in a dumb terminal" \
+ "use -m to supply message" >&2
+ exit 1
+ fi
${VISUAL:-${EDITOR:-vi}} "$GIT_DIR/COMMIT_EDITMSG"
;;
esac
--
1.1.6.g46dc-dirty
next reply other threads:[~2006-02-03 11:41 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-02-03 11:41 Amos Waterland [this message]
2006-02-03 19:56 ` [PATCH] do not open editor in dumb terminal Junio C Hamano
2006-02-05 0:37 ` Amos Waterland
2006-02-05 1:58 ` H. Peter Anvin
2006-02-05 2:54 ` Junio C Hamano
2006-02-05 5:04 ` Daniel Barkalow
2006-02-05 5:48 ` Junio C Hamano
2006-02-05 17:44 ` Petr Baudis
2006-02-06 0:56 ` Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20060203114133.GA11499@kvasir.watson.ibm.com \
--to=apw@us.ibm.com \
--cc=boutcher@cs.umn.edu \
--cc=git@vger.kernel.org \
--cc=junkio@cox.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).