From: Junio C Hamano <hidden> Date: 2016-06-15 22:42:35
Matthias Lederhofer [off-list ref] writes:
Junio C Hamano [off-list ref] wrote:
quoted
Matthias Lederhofer [off-list ref] writes:
quoted
quoted
Color support is controlled by status.color and status.color.*. There is no
command line option, and the status.color variable is a simple boolean (no
checking for tty output).
Is there any way to do isatty() from shell scripts?
Yes.
How? :)
Arrrrrrrgh! The message I wanted to send you went to Jeff.
Your Mail-Followup-To: fooled me. Please do not do this.
$ git grep -B1 'standard input' -- '*.sh'
git-commit.sh- test -t 0 &&
git-commit.sh: echo >&2 "(reading log message from standard input)"
Is there any reason not checking isatty()?
Not that I can think of, but do people really run "git status"?
I think Jeff's follow-up "vim colorizer" makes a lot more sense
than colorizing "git status" output -- it gives reminder during
the last chance the user has to notice such problems, which is
while composing the commit log message.
Matthias Lederhofer [off-list ref] writes:
Arrrrrrrgh! The message I wanted to send you went to Jeff.
Your Mail-Followup-To: fooled me. Please do not do this.
Sorry.
quoted
Is there any reason not checking isatty()?
Not that I can think of, but do people really run "git status"?
I do :)
I think Jeff's follow-up "vim colorizer" makes a lot more sense
than colorizing "git status" output -- it gives reminder during
the last chance the user has to notice such problems, which is
while composing the commit log message.
I like the colored git status. Here is a patch to honor isatty(1) and
pager_in_use (exporting GIT_PAGER_IN_USE) with pager.color.
---
From c01b26cd332283d3b3feaeae4a8218bb409aea2c Mon Sep 17 00:00:00 2001
From: Matthias Lederhofer <redacted>
Date: Sat, 5 Aug 2006 14:09:49 +0200
Subject: [PATCH] git-status: do not use colors all the time
Either [ -t 1 ] has to be true or the pager is used and pager.color is
not false.
Signed-off-by: Matthias Lederhofer <redacted>
---
git-commit.sh | 6 +++++-
pager.c | 1 +
2 files changed, 6 insertions(+), 1 deletions(-)
@@ -27,6 +27,7 @@ void setup_pager(void)return;pager_in_use=1;/* means we are emitting to terminal */+setenv("GIT_PAGER_IN_USE","1",1);if(pipe(fd)<0)return;
From: Jeff King <hidden> Date: 2016-06-15 22:42:35
On Sat, Aug 05, 2006 at 04:42:29AM -0700, Junio C Hamano wrote:
Not that I can think of, but do people really run "git status"?
I do! :) I actually wrote the vim colorizer first and used it for a
week before realizing it was not sufficient, and that I wanted
git-status output colorized, too. So please consider including the
patch.
I think Jeff's follow-up "vim colorizer" makes a lot more sense
than colorizing "git status" output -- it gives reminder during
the last chance the user has to notice such problems, which is
while composing the commit log message.
It looks like we have some similar emacs stuff in contrib/. Should I
prepare a short patch to create contrib/vim/?
-Peff
From: Jeff King <hidden> Date: 2016-06-15 22:42:35
On Sat, Aug 05, 2006 at 02:18:21PM +0200, Matthias Lederhofer wrote:
I like the colored git status. Here is a patch to honor isatty(1) and
pager_in_use (exporting GIT_PAGER_IN_USE) with pager.color.
Doesn't this have different behavior when you use 'git-status' rather
than 'git status'? Maybe rather than a boolean, we would be better off
with a true/false/auto value similar to diff.color.
-Peff
On Sat, Aug 05, 2006 at 02:18:21PM +0200, Matthias Lederhofer wrote:
quoted
I like the colored git status. Here is a patch to honor isatty(1) and
pager_in_use (exporting GIT_PAGER_IN_USE) with pager.color.
Doesn't this have different behavior when you use 'git-status' rather
than 'git status'? Maybe rather than a boolean, we would be better off
with a true/false/auto value similar to diff.color.
I don't see the case where git-status and git status behave
differently (except for git -p status but git-status does not have an
option for paging at all).
From: Sam Ravnborg <hidden> Date: 2016-06-15 22:42:36
Not that I can think of, but do people really run "git status"?
Always (almost) before I run 'git fetch'.
I do it to check that I have not made any local modifications that I
need to get rid of before fetching and that I do not have stale files
around.
One example is my copy of Linus' kernel tree. I use it now and then for
small experiments (can I reporoduce this bug etc) and when fetching I
want it to be gone.
Sam