git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] do not open editor in dumb terminal
@ 2006-02-03 11:41 Amos Waterland
  2006-02-03 19:56 ` Junio C Hamano
  2006-02-05 17:44 ` Petr Baudis
  0 siblings, 2 replies; 9+ messages in thread
From: Amos Waterland @ 2006-02-03 11:41 UTC (permalink / raw)
  To: junkio; +Cc: git, boutcher

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

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2006-02-06  0:56 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-02-03 11:41 [PATCH] do not open editor in dumb terminal Amos Waterland
2006-02-03 19:56 ` 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

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).