From: Brian Hetro <hidden> Date: 2016-06-15 22:43:31
Instead of disabling color all of the time during a git-commit, allow
the user's config preference in the situation where there is nothing
to commit. In this situation, the status is printed to the terminal
and not sent to COMMIT_EDITMSG, so honoring the status color setting
is expected.
Signed-off-by: Brian Hetro <redacted>
---
git-commit.sh | 10 ++++++----
1 files changed, 6 insertions(+), 4 deletions(-)
From: Jeff King <hidden> Date: 2016-06-15 22:43:31
On Sun, Aug 26, 2007 at 02:35:26PM -0400, Brian Hetro wrote:
Instead of disabling color all of the time during a git-commit, allow
the user's config preference in the situation where there is nothing
to commit. In this situation, the status is printed to the terminal
and not sent to COMMIT_EDITMSG, so honoring the status color setting
is expected.
Thanks, this had been annoying me for a while. For some reason, I was
thinking that it was not going to be trivial to fix, because I thought
for efficiency reasons we only ran run_status once and used the output
for either the commit template or for dumping to the user. But I can't
seem to find any revision where that is the case, so obviously somebody
spiked my drink. For a month.
A minor nit on the implementation:
+ if test "$status_only" = "t" -o "$use_status_color" = "t"; then
+ color=
+ else
+ color=--nocolor
+ fi
This variable doesn't really say "use color"; it says "don't explicitly
turn off color". So perhaps there is a better name (respect_color or
similar)?
-Peff
From: Brian Hetro <hidden> Date: 2016-06-15 22:43:31
On Mon, Aug 27, 2007 at 04:25:50 -0400, Jeff King wrote:
On Sun, Aug 26, 2007 at 02:35:26PM -0400, Brian Hetro wrote:
quoted
Instead of disabling color all of the time during a git-commit, allow
the user's config preference in the situation where there is nothing
to commit. In this situation, the status is printed to the terminal
and not sent to COMMIT_EDITMSG, so honoring the status color setting
is expected.
A minor nit on the implementation:
quoted
+ if test "$status_only" = "t" -o "$use_status_color" = "t"; then
+ color=
+ else
+ color=--nocolor
+ fi
This variable doesn't really say "use color"; it says "don't explicitly
turn off color". So perhaps there is a better name (respect_color or
similar)?
I was thinking more along the lines of "use color as if you had run
git-status" when I decided on $use_status_color. Perhaps there is a
better name.
Brian
From: Jeff King <hidden> Date: 2016-06-15 22:43:31
On Mon, Aug 27, 2007 at 05:45:43AM -0400, Brian Hetro wrote:
I was thinking more along the lines of "use color as if you had run
git-status" when I decided on $use_status_color. Perhaps there is a
better name.
I wonder if the implementation below is slightly more readable.
BTW, I suspect Junio will not apply this until post-1.5.3; I am starting
a queue of such patches that I care about and will re-send after the
release.
-Peff
---
Brian
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html