git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Brian Hetro <whee@smaertness.net>
To: Git Mailing List <git@vger.kernel.org>
Subject: Re: [PATCH] When nothing to git-commit, honor the git-status color setting.
Date: Mon, 27 Aug 2007 12:15:17 -0400	[thread overview]
Message-ID: <20070827161517.GA25484@ruiner> (raw)
In-Reply-To: <20070827101509.GB23248@coredump.intra.peff.net>

On Mon, Aug 27, 2007 at 06:15:09 -0400, Jeff King wrote:
> 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.

I do prefer your implementation.  There is no need to depend on
status_only here.

> I am starting a queue of such patches that I care about and will
> re-send after the release.

Please do.

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

      reply	other threads:[~2007-08-27 16:15 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-26 18:35 [PATCH] When nothing to git-commit, honor the git-status color setting Brian Hetro
2007-08-27  8:25 ` Jeff King
2007-08-27  9:45   ` Brian Hetro
2007-08-27 10:15     ` Jeff King
2007-08-27 16:15       ` Brian Hetro [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070827161517.GA25484@ruiner \
    --to=whee@smaertness.net \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).