git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] config.c: remove unused git_config_key_is_valid()

From
Jeff King <peff@peff.net>
Date
Sep 28, 2021, 18:03 UTC
Message-ID
<YVNY9OMJmXqs8EIl@coredump.intra.peff.net>
In-Reply-To
<patch-1.1-ba40601a511-20210928T125516Z-avarab@gmail.com>
On Tue, Sep 28, 2021 at 02:56:03PM +0200, Ævar Arnfjörð Bjarmason wrote:
Show 12 quoted lines
> 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
Previous: Ævar Arnfjörð BjarmasonNext: Taylor Blau
Message 2 of 3 in “config.c: remove unused git_config_key_is_valid()”
  1. config.c: remove unused git_config_key_is_valid()Ævar Arnfjörð Bjarmason, Sep 28, 2021
  2. Jeff KingSep 28, 2021
  3. Taylor BlauSep 29, 2021

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.