Thread (5 messages) flat view 5 messages, 2 authors, 2016-06-15

Re: [PATCH] When nothing to git-commit, honor the git-status color setting.

From: Jeff King <hidden>
Date: 2016-06-15 22:43:31
Subsystem: the rest · Maintainer: Linus Torvalds

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

---
diff --git a/git-commit.sh b/git-commit.sh
index d7e7028..96cec04 100755
--- a/git-commit.sh
+++ b/git-commit.sh
@@ -13,6 +13,7 @@ git rev-parse --verify HEAD >/dev/null 2>&1 || initial_commit=t
 case "$0" in
 *status)
 	status_only=t
+	no_override_color=t
 	;;
 *commit)
 	status_only=
@@ -49,7 +50,7 @@ run_status () {
 		export GIT_INDEX_FILE
 	fi
 
-	case "$status_only" in
+	case "$no_override_color" in
 	t) color= ;;
 	*) color=--nocolor ;;
 	esac
@@ -556,7 +557,7 @@ fi
 if [ "$?" != "0" -a ! -f "$GIT_DIR/MERGE_HEAD" -a -z "$amend" ]
 then
 	rm -f "$GIT_DIR/COMMIT_EDITMSG" "$GIT_DIR/SQUASH_MSG"
-	run_status
+	no_override_color=t run_status
 	exit 1
 fi
 
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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help