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.9 required=3.0 tests=AWL,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, 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 A67F21F8C8 for ; Tue, 28 Sep 2021 18:03:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242136AbhI1SFN (ORCPT ); Tue, 28 Sep 2021 14:05:13 -0400 Received: from cloud.peff.net ([104.130.231.41]:56832 "EHLO cloud.peff.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236453AbhI1SFN (ORCPT ); Tue, 28 Sep 2021 14:05:13 -0400 Received: (qmail 10595 invoked by uid 109); 28 Sep 2021 18:03:33 -0000 Received: from Unknown (HELO peff.net) (10.0.1.2) by cloud.peff.net (qpsmtpd/0.94) with ESMTP; Tue, 28 Sep 2021 18:03:33 +0000 Authentication-Results: cloud.peff.net; auth=none Received: (qmail 1846 invoked by uid 111); 28 Sep 2021 18:03:32 -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, 28 Sep 2021 14:03:32 -0400 Authentication-Results: peff.net; auth=none Date: Tue, 28 Sep 2021 14:03:32 -0400 From: Jeff King To: =?utf-8?B?w4Z2YXIgQXJuZmrDtnLDsA==?= Bjarmason Cc: git@vger.kernel.org, Junio C Hamano Subject: Re: [PATCH] config.c: remove unused git_config_key_is_valid() Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org On Tue, Sep 28, 2021 at 02:56:03PM +0200, Ævar Arnfjörð Bjarmason wrote: > The git_config_key_is_valid() function got left behind in a > refactoring in a9bcf6586d1 (alias: use the early config machinery to > expand aliases, 2017-06-14), > > It previously had two users when it was added in 9e9de18f1ad (config: > silence warnings for command names with invalid keys, 2015-08-24), and > after 6a1e1bc0a15 (pager: use callbacks instead of configset, > 2016-09-12) only one remained. > > By removing it we can get rid of the "quiet" branches in this > function, as well as cases where "store_key" is NULL, for which there > are no other users. Yeah, the patch here is trivially correct. The greater question is whether we're likely to need this quiet parameter again. I kind of doubt it given the history, so this seems like a sensible cleanup. > Out of the 5 callers of git_config_parse_key() only one needs to pass > a non-NULL "size_t *baselen_", so we could remove the third parameter > from the public interface. I did not find that potential > simplification to be worthwhile. Yeah, I think stopping here is good for now. -Peff