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: AS31976 209.132.180.0/23 X-Spam-Status: No, score=-4.0 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by dcvr.yhbt.net (Postfix) with ESMTP id 262951F45D for ; Mon, 23 Mar 2020 19:21:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727659AbgCWTVN (ORCPT ); Mon, 23 Mar 2020 15:21:13 -0400 Received: from pb-smtp1.pobox.com ([64.147.108.70]:59356 "EHLO pb-smtp1.pobox.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727479AbgCWTVM (ORCPT ); Mon, 23 Mar 2020 15:21:12 -0400 Received: from pb-smtp1.pobox.com (unknown [127.0.0.1]) by pb-smtp1.pobox.com (Postfix) with ESMTP id 2A6A144700; Mon, 23 Mar 2020 15:21:10 -0400 (EDT) (envelope-from junio@pobox.com) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=sasl; bh=a4837P+WIweIDlmhpcuBVSsjAbI=; b=Zt7/jQ nXfujKLdSfGLjQbUbRNdGTMhrJLTCvfA7RPvGggiHTY5VSeO+w96H6+50xLcMibL OSJIMNABkHT7H7GMkjQaLO3jGqdSvZhVNZvC7zP54Kqkc5BbqlL03Lj+/BYyuO4i 1dT1Vv6PjEEwJssNXq28K7oqxbVSsqbiu/2S8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; q=dns; s=sasl; b=Di2+snL0exJcoWtD5bZeFa0fJ4C4WC2o uvsX9OiIwSbnSJ9J6T48bJHjA6bVhfn3mQSnbfnH/YO7UqqKmD+WpsD+k+E4ls+K DuPFKab5I0fg++RO/zjTh/gBjy2oZrpncvggAqtBRHp+bEx2jHEum284ajFwZ9hq PnUTYcKEo5c= Received: from pb-smtp1.nyi.icgroup.com (unknown [127.0.0.1]) by pb-smtp1.pobox.com (Postfix) with ESMTP id 20594446FF; Mon, 23 Mar 2020 15:21:10 -0400 (EDT) (envelope-from junio@pobox.com) Received: from pobox.com (unknown [34.74.119.39]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pb-smtp1.pobox.com (Postfix) with ESMTPSA id 38A2C446FD; Mon, 23 Mar 2020 15:21:09 -0400 (EDT) (envelope-from junio@pobox.com) From: Junio C Hamano To: Jeff King Cc: Johannes Schindelin via GitGitGadget , git@vger.kernel.org, Johannes Schindelin Subject: Re: [PATCH 2/2] tests(gpg): increase verbosity to allow debugging References: <20200323173258.GA3977@coredump.intra.peff.net> <20200323180445.GA31401@coredump.intra.peff.net> Date: Mon, 23 Mar 2020 12:21:08 -0700 In-Reply-To: <20200323180445.GA31401@coredump.intra.peff.net> (Jeff King's message of "Mon, 23 Mar 2020 14:04:45 -0400") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Pobox-Relay-ID: 7343D336-6D3B-11EA-90BC-C28CBED8090B-77302942!pb-smtp1.pobox.com Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Jeff King writes: > Actually, it's pretty straight-forward and I think the resulting code is > cleaner. Note that we do have to use a real expect_success because of > the side effects. That does increment the test counter. IMHO that's not > a big deal, but if we're concerned it wouldn't be too hard to add a > non-lazy prereq block. > > Patch is below (I pulled GPGSM into its own block, which involved > reindenting; view with "-w"). Nice. Certainly a lot nicer than having to reason about what fd#3 and fd#4 are, which I always have keeping in my head. > @@ -31,51 +34,51 @@ then > chmod 0700 ./gpghome && > GNUPGHOME="$PWD/gpghome" && > export GNUPGHOME && > - (gpgconf --kill gpg-agent >/dev/null 2>&1 || : ) && > - gpg --homedir "${GNUPGHOME}" 2>/dev/null --import \ > + (gpgconf --kill gpg-agent || : ) && > + gpg --homedir "${GNUPGHOME}" --import \ > "$TEST_DIRECTORY"/lib-gpg/keyring.gpg && > - gpg --homedir "${GNUPGHOME}" 2>/dev/null --import-ownertrust \ > + gpg --homedir "${GNUPGHOME}" --import-ownertrust \ > "$TEST_DIRECTORY"/lib-gpg/ownertrust && Good to see all "discard output" go. > - gpg --homedir "${GNUPGHOME}" /dev/null 2>&1 \ > - --sign -u committer@example.com && > - test_set_prereq GPG && > + gpg --homedir "${GNUPGHOME}" \ > + --sign -u committer@example.com >/dev/null && We lost input redirection; I am assuming that it was unnecessary as the standard input of our tests are all redirected from /dev/null anyway? We are not interested in seeing the signed output (we have nothing to compare to validate the correctness anyway), so discarding the standard output is fine. We do not want to see it even while we are debugging, either. Looking good.