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 5C28F1F4B4 for ; Tue, 13 Apr 2021 07:33:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239694AbhDMHda (ORCPT ); Tue, 13 Apr 2021 03:33:30 -0400 Received: from cloud.peff.net ([104.130.231.41]:50824 "EHLO cloud.peff.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238142AbhDMHd3 (ORCPT ); Tue, 13 Apr 2021 03:33:29 -0400 Received: (qmail 28657 invoked by uid 109); 13 Apr 2021 07:33:09 -0000 Received: from Unknown (HELO peff.net) (10.0.1.2) by cloud.peff.net (qpsmtpd/0.94) with ESMTP; Tue, 13 Apr 2021 07:33:09 +0000 Authentication-Results: cloud.peff.net; auth=none Received: (qmail 23187 invoked by uid 111); 13 Apr 2021 07:33:10 -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; Tue, 13 Apr 2021 03:33:10 -0400 Authentication-Results: peff.net; auth=none Date: Tue, 13 Apr 2021 03:33:08 -0400 From: Jeff King To: Patrick Steinhardt Cc: git@vger.kernel.org, Junio C Hamano , =?utf-8?B?w4Z2YXIgQXJuZmrDtnLDsA==?= Bjarmason , Eric Sunshine Subject: Re: [PATCH v4 3/3] config: allow overriding of global and system configuration Message-ID: References: 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 Tue, Apr 13, 2021 at 09:11:52AM +0200, Patrick Steinhardt wrote: > +test_expect_success 'override global and system config with missing file' ' > + sane_unset GIT_CONFIG_NOSYSTEM && > + test_must_fail env GIT_CONFIG_GLOBAL=does-not-exist GIT_CONFIG_SYSTEM=/dev/null git config --global --list >actual && > + test_must_fail env GIT_CONFIG_GLOBAL=/dev/null GIT_CONFIG_SYSTEM=does-not-exist git config --system --list >actual && > + GIT_CONFIG_GLOBAL=does-not-exist GIT_CONFIG_SYSTEM=does-not-exist git version > +' I was slightly surprised to see these still marked as test_must_fail. But it's because git-config, when given a _specific_ file to read, will complain if the file doesn't exist. And that is true independent of your patch. There is one interesting implication there. Running: GIT_CONFIG_SYSTEM=/dev/null git config --system --list does _not_ complain, even though: GIT_CONFIG_NOSYSTEM=1 git config --system --list does. IMHO that is quite sensible, but I wanted to point it out, as using /dev/null is not an exact replacement for GIT_CONFIG_NOSYSTEM (in my opinion it is even better ;) ). -Peff