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, 21:31 UTC
Message-ID
<xmqqd1rvhvmq.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<xmqqa8mzjh7d.fsf@gitster.mtv.corp.google.com>
Junio C Hamano <gitster@pobox.com> writes:
Show 14 quoted lines
> 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.

You seem to use in 3/3 "origin type", and I think that is a sensible phrasing. Renaming 'type' to 'origin' in this patch would not be a good idea, but renaming it to 'origin_type' would be a great thing to do.

In the context of configuration parsing, 'origin' would be like "file called .git/config", "standard input", "command line's 3rd argument", etc., i.e. for some origin types, it would consist of <origin_type=file, origin_value=.git/config> pair, while some other origin type (e.g. "standard input") there is no need for an "origin_value" that further qualifies the origin.

Thanks.
Previous: Junio C HamanoNext: Lars Schneider
Message 5 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.