git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeremiah Mahler <jmmahler@gmail.com>
To: Caleb Thompson <cjaysson@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: commit: support commit.verbose and --no-verbose
Date: Sat, 24 May 2014 00:52:19 -0700	[thread overview]
Message-ID: <20140524075219.GA17093@hudson.localdomain> (raw)
In-Reply-To: <20140523212222.GA10412@sirius.local>


On Fri, May 23, 2014 at 04:22:22PM -0500, Caleb Thompson wrote:
> This patch allows people to set `commit.verbose` to implicitly send `--verbose`
...
>  
> +cat >check-for-no-diff <<EOF
> +#!$SHELL_PATH
> +exec grep -v '^diff --git' "\$1"
> +EOF
> +chmod +x check-for-no-diff
> +

For new tests, commands like this should be placed inside a
test_expect_success structure.  However, I can see why you did it this
way since the code just above it does it this way.
Perhaps others will have some recommendations.

Also, <<\-EOF is used instead of <<EOF to remove the tabs.

test_expect_success 'commit verbose setup' '
	cat >check-for-no-diff <<\-EOF &&
	#!SHELL_PATH
	exec grep -v '^diff --git' "\$1"
	EOF
	chmod +x check-for-no-diff
'

>  
> +test_expect_success 'commit shows verbose diff with set commit.verbose' '
> +	echo morecontent >file &&
> +	git add file &&
> +	git config commit.verbose true &&
> +	check_message message
> +'

'test_config' should be used to set config variables since it
also takes care of un-setting them when the test is complete.

test_expect_success 'commit shows verbose diff with set commit.verbose' '
	echo morecontent >file &&
	git add file &&
	test_config commit.verbose true &&
	check_message message
'

-- 
Jeremiah Mahler
jmmahler@gmail.com
http://github.com/jmahler

  reply	other threads:[~2014-05-24  7:52 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-23 21:22 commit: support commit.verbose and --no-verbose Caleb Thompson
2014-05-24  7:52 ` Jeremiah Mahler [this message]
2014-05-27 18:10   ` Junio C Hamano
2014-05-24  9:25 ` Duy Nguyen

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=20140524075219.GA17093@hudson.localdomain \
    --to=jmmahler@gmail.com \
    --cc=cjaysson@gmail.com \
    --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).