From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS53758 23.128.96.0/24 X-Spam-Status: No, score=-3.8 required=3.0 tests=AWL,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_PASS, SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by dcvr.yhbt.net (Postfix) with ESMTP id 92CBF1F953 for ; Fri, 10 Dec 2021 09:47:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239526AbhLJJvF (ORCPT ); Fri, 10 Dec 2021 04:51:05 -0500 Received: from cloud.peff.net ([104.130.231.41]:48586 "EHLO cloud.peff.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230296AbhLJJvE (ORCPT ); Fri, 10 Dec 2021 04:51:04 -0500 Received: (qmail 18147 invoked by uid 109); 10 Dec 2021 09:47:29 -0000 Received: from Unknown (HELO peff.net) (10.0.1.2) by cloud.peff.net (qpsmtpd/0.94) with ESMTP; Fri, 10 Dec 2021 09:47:29 +0000 Authentication-Results: cloud.peff.net; auth=none Received: (qmail 28758 invoked by uid 111); 10 Dec 2021 09:47:26 -0000 Received: from coredump.intra.peff.net (HELO sigill.intra.peff.net) (10.0.0.2) by peff.net (qpsmtpd/0.94) with (TLS_AES_256_GCM_SHA384 encrypted) ESMTPS; Fri, 10 Dec 2021 04:47:26 -0500 Authentication-Results: peff.net; auth=none Date: Fri, 10 Dec 2021 04:47:23 -0500 From: Jeff King To: SZEDER =?utf-8?B?R8OhYm9y?= Cc: =?utf-8?B?w4Z2YXIgQXJuZmrDtnLDsA==?= Bjarmason , git@vger.kernel.org, Junio C Hamano , Derrick Stolee , Taylor Blau Subject: Re: [PATCH v2 1/2] t1510: remove need for "test_untraceable", retain coverage Message-ID: References: <20211202191635.GB1991@szeder.dev> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20211202191635.GB1991@szeder.dev> Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org On Thu, Dec 02, 2021 at 08:16:35PM +0100, SZEDER Gábor wrote: > > @@ -62,7 +59,7 @@ test_repo () { > > export GIT_WORK_TREE > > fi && > > rm -f trace && > > - GIT_TRACE_SETUP="$(pwd)/trace" git symbolic-ref HEAD >/dev/null && > > + GIT_TRACE_SETUP="$(pwd)/trace" git symbolic-ref HEAD >/dev/null 2>>stderr && > > I suspect that it's lines like this that make Peff argue for > BASH_XTRACEFD :) > > While this is not a compound command, it does contain a command > substitution, and the trace generated when executing the command in > that command substitution goes to the command's stderr, and then, > because of the redirection, to the 'stderr' file. Better still, the behavior varies between shells: $ bash -c 'set -x; FOO=$(echo foo) echo main >stdout 2>stderr; set +x; grep . stdout stderr' ++ echo foo + FOO=foo + echo main + set +x stdout:main $ dash -c 'set -x; FOO=$(echo foo) echo main >stdout 2>stderr; set +x; grep . stdout stderr' + FOO=foo echo main + set +x stdout:main stderr:+ echo foo -Peff