summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 67aca45)
raw | patch | inline | side by side (parent: 67aca45)
author | Brian Hetro <whee@smaertness.net> | |
Sun, 26 Aug 2007 18:35:26 +0000 (14:35 -0400) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Sun, 26 Aug 2007 21:01:47 +0000 (14:01 -0700) |
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 <whee@smaertness.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
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 <whee@smaertness.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
git-commit.sh | patch | blob | history |
diff --git a/git-commit.sh b/git-commit.sh
index d7e7028c15aeceaf2ba64a82ee9fc15f54b20eaa..1d04f1ff31cf99a6dec1d52866668007ab2dae72 100755 (executable)
--- a/git-commit.sh
+++ b/git-commit.sh
export GIT_INDEX_FILE
fi
- case "$status_only" in
- t) color= ;;
- *) color=--nocolor ;;
- esac
+ if test "$status_only" = "t" -o "$use_status_color" = "t"; then
+ color=
+ else
+ color=--nocolor
+ fi
git runstatus ${color} \
${verbose:+--verbose} \
${amend:+--amend} \
if [ "$?" != "0" -a ! -f "$GIT_DIR/MERGE_HEAD" -a -z "$amend" ]
then
rm -f "$GIT_DIR/COMMIT_EDITMSG" "$GIT_DIR/SQUASH_MSG"
+ use_status_color=t
run_status
exit 1
fi