git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Sixt <j6t@kdbg.org>
To: Eric Sunshine <sunshine@sunshineco.com>,
	Michael Rappazzo <rappazzo@gmail.com>
Cc: git@vger.kernel.org, gitster@pobox.com, pclouds@gmail.com,
	szeder@ira.uka.de, peff@peff.net
Subject: Re: [PATCH v2 2/2] t1500-rev-parse: rewrite each test to run in isolation
Date: Sun, 17 Apr 2016 17:05:33 +0200	[thread overview]
Message-ID: <5713A63D.3060200@kdbg.org> (raw)
In-Reply-To: <20160417055955.GA13384@flurp.local>

Am 17.04.2016 um 07:59 schrieb Eric Sunshine:
> On Sat, Apr 16, 2016 at 12:13:50PM -0400, Michael Rappazzo wrote:
>> +test_expect_success 'GIT_DIR=../.git, core.bare = false: prefix' '
>> +	mkdir work &&
>> +	test_when_finished "rm -rf work" &&
>> +	test_config -C "$(pwd)"/.git core.bare false &&
>> +	GIT_DIR=../.git test_stdout "" git -C work rev-parse --show-prefix >actual
>
> Drop the unnecessary '>actual' redirection.

Not only that: setting an environment variable in front of a shell 
function invocation keeps the variable's value in some (most?) shells. 
This occurs frequently in the new code. I don't know whether we have a 
shorter pattern than

	(
		GIT_DIR=../.git &&
		export GIT_DIR &&
		test_stdout "" git -C work rev-parse --show-prefix
	)

-- Hannes

  reply	other threads:[~2016-04-17 15:06 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-16 16:13 [PATCH v2 0/2] t1500-rev-parse: re-write t1500 Michael Rappazzo
2016-04-16 16:13 ` [PATCH v2 1/2] test-lib: add a function to compare an expection with stdout from a command Michael Rappazzo
2016-04-17  3:07   ` Eric Sunshine
2016-04-17  3:54     ` Jeff King
2016-04-17  6:36       ` Eric Sunshine
2016-04-17  6:41         ` Jeff King
2016-04-17 15:19     ` Johannes Sixt
2016-04-17 16:22       ` Eric Sunshine
2016-04-16 16:13 ` [PATCH v2 2/2] t1500-rev-parse: rewrite each test to run in isolation Michael Rappazzo
2016-04-17  5:59   ` Eric Sunshine
2016-04-17 15:05     ` Johannes Sixt [this message]
2016-04-17  9:42   ` SZEDER Gábor
2016-04-17 16:15     ` Eric Sunshine

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=5713A63D.3060200@kdbg.org \
    --to=j6t@kdbg.org \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=pclouds@gmail.com \
    --cc=peff@peff.net \
    --cc=rappazzo@gmail.com \
    --cc=sunshine@sunshineco.com \
    --cc=szeder@ira.uka.de \
    /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).