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: AS3215 2.6.0.0/16 X-Spam-Status: No, score=-3.8 required=3.0 tests=AWL,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by dcvr.yhbt.net (Postfix) with ESMTP id BBB201F910 for ; Thu, 24 Nov 2022 01:16:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229757AbiKXBQJ (ORCPT ); Wed, 23 Nov 2022 20:16:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47104 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229673AbiKXBQI (ORCPT ); Wed, 23 Nov 2022 20:16:08 -0500 Received: from cloud.peff.net (cloud.peff.net [104.130.231.41]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C4F35FF419 for ; Wed, 23 Nov 2022 17:16:07 -0800 (PST) Received: (qmail 24377 invoked by uid 109); 24 Nov 2022 01:16:07 -0000 Received: from Unknown (HELO peff.net) (10.0.1.2) by cloud.peff.net (qpsmtpd/0.94) with ESMTP; Thu, 24 Nov 2022 01:16:07 +0000 Authentication-Results: cloud.peff.net; auth=none Received: (qmail 21558 invoked by uid 111); 24 Nov 2022 01:16:07 -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; Wed, 23 Nov 2022 20:16:07 -0500 Authentication-Results: peff.net; auth=none Date: Wed, 23 Nov 2022 20:16:06 -0500 From: Jeff King To: Junio C Hamano Cc: Jiang Xin , Taylor Blau , Git List , Kyle Zhao , Jiang Xin Subject: Re: [PATCH] t5516: fail to run in verbose mode Message-ID: References: <20221121134040.12260-1-worldhello.net@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org On Wed, Nov 23, 2022 at 10:17:29AM +0900, Junio C Hamano wrote: > Jeff King writes: > > > I agree this is a good fix for now, but I wonder philosophically what it > > means. That is, I could see two arguments: > > > > 1. Our tests sometimes run with stderr connected to a tty and > > sometimes not. This means the test environment isn't consistent, > > and perhaps we should be piping all "-v" tests through "cat" or > > something so that the environment is stable. > > Yes, this is tempting (and I almost brought it up in my response), > and a pipe to "|cat" may be hopefully closer than tester's tty to > the redirection to "/dev/null". I didn't know how much closer, > though, and the differences may still matter (we could teach "git > grep" or "git diff --exit-code" to notice that the output is sent to > /dev/null and stop at the first hit, for example), but still "|cat" > is closer than ">/dev/tty". One thing I'd worry about is buffering. One of the nice things about "-v" is that there is nothing between you and the running programs, so you are much less likely to be fooled about the order of events in the output. Or wondering why nothing is happening because real-time output seems to have stalled. But piping through "cat" may end up with weird pauses while it fills up a 4k buffer. Using stdbuf could help, but that's far from portable. -Peff