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

Re: [PATCH v5 2/3] config: add 'type' to config_source struct that identifies config type

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 17, 2016, 18:59 UTC
Message-ID
<xmqqa8mzjh7d.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<1455699468-45443-3-git-send-email-larsxschneider@gmail.com>
larsxschneider@gmail.com writes:
> From: Lars Schneider <larsxschneider@gmail.com>
>
> Use the config type to print more detailed error messages that inform
> the user about the origin of a config error (file, stdin, blob).

"type" is too broad a word in the context of configuration file, and does not help readers as a variable or a field name in a structure. You are not talking about "this is a binary typed variable", for example.

If showing the origin is useful to the user, that origin should be called origin, not type, I would think.

Show 10 quoted lines
> diff --git a/t/t1308-config-set.sh b/t/t1308-config-set.sh
> index 91235b7..82f82a1 100755
> --- a/t/t1308-config-set.sh
> +++ b/t/t1308-config-set.sh
> @@ -195,14 +195,14 @@ test_expect_success 'proper error on error in default config files' '
>  	cp .git/config .git/config.old &&
>  	test_when_finished "mv .git/config.old .git/config" &&
>  	echo "[" >>.git/config &&
> -	echo "fatal: bad config file line 34 in .git/config" >expect &&
> +	echo "fatal: bad config line 34 in file .git/config" >expect &&
This definitely is a great improvement ;-)
Show 11 quoted lines
>  	test_expect_code 128 test-config get_value foo.bar 2>actual &&
>  	test_cmp expect actual
>  '
>  
>  test_expect_success 'proper error on error in custom config files' '
>  	echo "[" >>syntax-error &&
> -	echo "fatal: bad config file line 1 in syntax-error" >expect &&
> +	echo "fatal: bad config line 1 in file syntax-error" >expect &&
>  	test_expect_code 128 test-config configset_get_value foo.bar syntax-error 2>actual &&
>  	test_cmp expect actual
>  '
Previous: larsxschneider@gmail.comNext: Junio C Hamano
Message 4 of 7 in “config: add '--sources' option to print the source of a config value”
  1. 0/3 config: add '--sources' option to print the source of a config valuelarsxschneider@gmail.com, Feb 17, 2016
  2. 1/3 t: do not hide Git's exit code in tests using 'nul_to_q'larsxschneider@gmail.com, Feb 17, 2016
  3. 2/3 config: add 'type' to config_source struct that identifies config typelarsxschneider@gmail.com, Feb 17, 2016
  4. Junio C HamanoFeb 17, 2016
  5. Junio C HamanoFeb 17, 2016
  6. Lars SchneiderFeb 18, 2016
  7. 3/3 config: add '--show-origin' option to print the origin of a config valuelarsxschneider@gmail.com, Feb 17, 2016

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.