Re: [PATCH v6 6/6] config: "git config --get-urlmatch" parses section.<url>.key
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Aug 1, 2013, 17:25 UTC
- Message-ID
- <7vob9hs4qu.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <20130731234448.GA8764@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 19 quoted lines
> That being said, git-config _should_ be lowercasing to match the normal
> --get code path. I think the fix (squashable on top of 6/6 + my earlier
> patch) is just:
>
> diff --git a/builtin/config.c b/builtin/config.c
> index c35c5be..9328a90 100644
> --- a/builtin/config.c
> +++ b/builtin/config.c
> @@ -589,7 +589,9 @@ int cmd_config(int argc, const char **argv, const char *prefix)
> }
> else if (actions == ACTION_GET_URLMATCH) {
> check_argc(argc, 2, 2);
> - return get_urlmatch(argv[0], argv[1]);
> + if (git_config_parse_key(argv[0], &key, NULL))
> + return CONFIG_INVALID_KEY;
> + return get_urlmatch(key, argv[1]);
> }
> else if (actions == ACTION_UNSET) {
> check_argc(argc, 1, 2);If we drop the "list every key in section.*" mode, the above should be sufficient, I think.
I do not know how useful it would be to be for a scripted Porcelain to be able to ask
$ git config --get-urlmatch http https://weak.example.com/path/to/git.git
and get all the "http.*" variables that will apply to the given URL.