Re: [PATCH v5 1/2] config: let git_config_parse_key() validate quietly
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jun 2, 2026, 14:08 UTC
- Message-ID
- <xmqqtsrlujah.fsf@gitster.g>
- In-Reply-To
- <d938ebf95a817c00a415670c08b839747d711d29.1780407557.git.gitgitgadget@gmail.com>
"Harald Nordgren via GitGitGadget" <gitgitgadget@gmail.com> writes:
Show 5 quoted lines
> From: Harald Nordgren <haraldnordgren@gmail.com> > > Add a "quiet" parameter that suppresses the error() calls, and let > store_key be NULL to skip the canonical-copy allocation. Existing > callers pass 0 for quiet.
Hmph.
The way this patch did this may have been easier to implement, but is a bit different from what I had in mind when I suggested to "refactor" the existing logic.
Perhaps the updated "git_config_parse_key()" in this patch should be renamed to be a file-scape static internal helper, and the existing "git_config_parse_key()" should become a thin wrapper around that new helper function, retaining the current external interface, requiring no changes to existing callers.
Then in the next step, config.[ch] can add a new entry point that serves the purpose of is_valid_key() in the previous iteration, perhaps call it is_valid_git_config_key() or something like that (Patrick or others may want to suggest a better word order in its name). That way, we do not have to sprinkle many calls into this (rather ugly) version of git_config_parse_key() with overly wide interface that repeats meaningless NULL/0/1 parameters that no callers want to use (other than for the purpose of differenciating the real git_config_parse_key() calls from the new calls made to the same function to ask "is this a valid key or not, yes/no?".
Thanks.