git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: "SZEDER Gábor" <szeder.dev@gmail.com>
To: Derrick Stolee <stolee@gmail.com>
Cc: git@vger.kernel.org, "Thomas Gummerer" <t.gummerer@gmail.com>,
	"Nguyễn Thái Ngọc Duy" <pclouds@gmail.com>
Subject: Re: [PATCH 1/6] t1600-index: remove unnecessary redirection
Date: Tue, 17 Aug 2021 20:39:17 +0200	[thread overview]
Message-ID: <20210817183917.GC2257957@szeder.dev> (raw)
In-Reply-To: <d8d8d59a-ecac-2cd5-18a3-f1cb65e48c2e@gmail.com>

On Tue, Aug 17, 2021 at 02:12:36PM -0400, Derrick Stolee wrote:
> On 8/17/2021 1:49 PM, SZEDER Gábor wrote:
> > In a helper function in the 't1600-index.sh' test script the stderr
> > of a 'git add' command is redirected to its stdout, but its stdout is
> > not redirected anywhere.  So apparently this redirection is
> > unnecessary, remove it.
> > 
> > Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com>
> > ---
> >  t/t1600-index.sh | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/t/t1600-index.sh b/t/t1600-index.sh
> > index c9b9e718b8..5d10cec67a 100755
> > --- a/t/t1600-index.sh
> > +++ b/t/t1600-index.sh
> > @@ -79,7 +79,7 @@ test_index_version () {
> >  		else
> >  			unset GIT_INDEX_VERSION
> >  		fi &&
> > -		git add a 2>&1 &&
> > +		git add a &&
> >  		echo $EXPECTED_OUTPUT_VERSION >expect &&
> >  		test-tool index-version <.git/index >actual &&
> >  		test_cmp expect actual
> 
> Since here we have a 'test_cmp expect actual', perhaps the
> actual mistake is that the line isn't
> 
> 	git add a 2>&1 >actual &&
> 
> What do you think about that?

The actual file is written two lines later as:

  test-tool index-version <.git/index >actual

So it seems that neither stdout nor stderr of that 'git add' command
matters.

However, in most of the preceeding tests 'git add's stderr does indeed
matter, as they do:

    git add a 2>&1 | sed "s/[0-9]//" >actual.err &&
    # write expect.err
    test_cmp expect.err actual.err

I suspect that the 2>&1 redirection this patch is removing might have
been a copy-paste error.


  reply	other threads:[~2021-08-17 18:39 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-17 17:49 [PATCH 0/6] Fix GIT_TEST_SPLIT_INDEX SZEDER Gábor
2021-08-17 17:49 ` [PATCH 1/6] t1600-index: remove unnecessary redirection SZEDER Gábor
2021-08-17 18:12   ` Derrick Stolee
2021-08-17 18:39     ` SZEDER Gábor [this message]
2021-08-17 18:48       ` Derrick Stolee
2021-08-17 17:49 ` [PATCH 2/6] t1600-index: don't run git commands upstream of a pipe SZEDER Gábor
2021-08-17 17:49 ` [PATCH 3/6] t1600-index: disable GIT_TEST_SPLIT_INDEX SZEDER Gábor
2021-08-17 17:49 ` [PATCH 4/6] read-cache: look for shared index files next to the index, too SZEDER Gábor
2021-08-17 17:49 ` [PATCH 5/6] tests: disable GIT_TEST_SPLIT_INDEX for sparse index tests SZEDER Gábor
2021-08-17 18:26   ` Derrick Stolee
2021-08-17 21:32     ` SZEDER Gábor
2021-08-18 18:51       ` Derrick Stolee
2021-08-17 17:49 ` [PATCH 6/6] read-cache: fix GIT_TEST_SPLIT_INDEX SZEDER Gábor
2021-08-17 18:29   ` Derrick Stolee
2021-08-26 20:59 ` [PATCH v2 0/6] Fix GIT_TEST_SPLIT_INDEX SZEDER Gábor
2021-08-26 20:59   ` [PATCH v2 1/6] t1600-index: remove unnecessary redirection SZEDER Gábor
2021-08-26 21:00   ` [PATCH v2 2/6] t1600-index: don't run git commands upstream of a pipe SZEDER Gábor
2021-08-26 21:00   ` [PATCH v2 3/6] t1600-index: disable GIT_TEST_SPLIT_INDEX SZEDER Gábor
2021-08-26 21:00   ` [PATCH v2 4/6] read-cache: look for shared index files next to the index, too SZEDER Gábor
2021-08-26 21:00   ` [PATCH v2 5/6] tests: disable GIT_TEST_SPLIT_INDEX for sparse index tests SZEDER Gábor
2021-08-26 21:00   ` [PATCH v2 6/6] read-cache: fix GIT_TEST_SPLIT_INDEX SZEDER Gábor
2021-08-31 14:47   ` [PATCH v2 0/6] Fix GIT_TEST_SPLIT_INDEX Derrick Stolee
2021-08-31 17:38     ` Junio C Hamano

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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=20210817183917.GC2257957@szeder.dev \
    --to=szeder.dev@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=pclouds@gmail.com \
    --cc=stolee@gmail.com \
    --cc=t.gummerer@gmail.com \
    /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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).