All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Jeff King <peff@peff.net>
Cc: Johannes Schindelin <johannes.schindelin@gmx.de>, git@vger.kernel.org
Subject: Re: [PATCH 2/2] t3404: be resilient against running with the -x flag
Date: Tue, 10 May 2016 14:13:26 -0700	[thread overview]
Message-ID: <xmqqpostmxah.fsf@gitster.mtv.corp.google.com> (raw)
In-Reply-To: <20160510205800.GC19958@sigill.intra.peff.net> (Jeff King's message of "Tue, 10 May 2016 16:58:01 -0400")

Jeff King <peff@peff.net> writes:

> On Tue, May 10, 2016 at 12:49:42PM -0700, Junio C Hamano wrote:
>
>> I wonder if we can fix "-x" instead so that we do not have to
>> butcher tests like this patch does.  It was quite clear what it
>> expected to see before this patch, and it is sad that the workaround
>> makes less readable (and relies on the real output we are looking
>> for never begins with '+').
>
> I don't think there is a scalable, portable way to do so. "-x" output is
> going to stderr, and is inherited by any functions or subshells. So
> either we have to ask "-x" output to go somewhere else, or we have to
> turn it off inside the functions and subshells. The latter requires
> tweaking each site, which isn't scalable. And there is no way to do the
> former in a portable way (AFAIK).

Yeah, that was the conclusion I was coming to; the same "unscalable"
argument applies to the patch under discussion, too.

> That being said, bash supports BASH_XTRACEFD, so maybe something like
> this:
>
> diff --git a/t/test-lib.sh b/t/test-lib.sh
> index 286c5f3..482ec11 100644
> --- a/t/test-lib.sh
> +++ b/t/test-lib.sh
> @@ -321,6 +321,7 @@ then
>  else
>  	exec 4>/dev/null 3>/dev/null
>  fi
> +BASH_XTRACEFD=4
>  
>  test_failure=0
>  test_count=0
>
> would help Dscho's case (and people on other shells aren't helped, but
> they are not hurt either).

Yeah, something like that I would greatly appreciate.

  reply	other threads:[~2016-05-10 21:13 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-10 13:59 [PATCH 0/2] Work on t3404 in preparation for rebase--helper Johannes Schindelin
2016-05-10 14:05 ` [PATCH 1/2] t3404: fix typo Johannes Schindelin
2016-05-10 14:07 ` [PATCH 2/2] t3404: be resilient against running with the -x flag Johannes Schindelin
2016-05-10 19:49   ` Junio C Hamano
2016-05-10 20:58     ` Jeff King
2016-05-10 21:13       ` Junio C Hamano [this message]
2016-05-10 21:32         ` [PATCH] test-lib: set BASH_XTRACEFD automatically Jeff King
2016-05-10 22:06           ` Junio C Hamano
2016-05-11 13:44             ` [PATCH v2] " Jeff King
2016-05-12 15:39               ` Johannes Schindelin
2016-05-12 15:43 ` [PATCH v2 0/2] Work on t3404 in preparation for rebase--helper Johannes Schindelin
2016-05-12 15:44   ` [PATCH v2 1/2] t3404: fix typo Johannes Schindelin
2016-05-12 15:44   ` [PATCH v2 2/2] test-lib: set BASH_XTRACEFD automatically Johannes Schindelin
2016-05-12 16:21   ` [PATCH v2 0/2] Work on t3404 in preparation for rebase--helper Junio C Hamano
2016-05-13  6:37     ` Johannes Schindelin
2016-05-13 17:57       ` Junio C Hamano
2016-05-16  6:33         ` Johannes Schindelin

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=xmqqpostmxah.fsf@gitster.mtv.corp.google.com \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=johannes.schindelin@gmx.de \
    --cc=peff@peff.net \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.