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

Re: Bug: Git Maintenance does not register multiple repos

From
PWPhillip Wood <phillip.wood123@gmail.com>
Date
Jun 21, 2024, 10:10 UTC
Message-ID
<d0deaa08-2894-4e89-ba51-7bed8e785ef3@gmail.com>
In-Reply-To
<4480de3f-851f-4cf7-889f-b5ab7c4e0223@app.fastmail.com>
On 21/06/2024 07:58, Kristoffer Haugsbakk wrote:
> On Thu, Jun 20, 2024, at 17:34, Shubham Kanodia wrote:
>> 1. What spec does the config file follow?
> 
> Apparently there isn’t a spec because it is bespoke.
The syntax is documented on the "git config" man page.
Show 10 quoted lines
>> 2. What is the correct way then to get an "effective" git config
>> value? Typically, I assumed that if a value appeared twice in the git
>> config, the second would override the first (for say, `core.editor`).
>>    How does git parse "overrides" vs "arrays" if they are defined using
>> the same syntax?
> 
> There are two dimensions
> 
> 1. How config variables are parsed
> 2. What is expected of the specific config variable

To expand a little on what Kristoffer has said - this means that you need to know in advance what type of variable you are checking. You can do that by reading the documentation for that variable on the "git config" man page. "git config" also offers the --type=<type> option to normalize values to the expected type.

Best Wishes
Phillip
Show 26 quoted lines
> `core.editor` is a single value. You can test with
> 
> ```
> [core]
> 	editor=vim
> 	editor=nano
> ```
> 
> The last one wins here. `core.editor` expects a single value.
> 
> But you can define a multi-valued variable
> 
> ```
> [customsection]
>      mycustomvariable = value1
>      mycustomvariable = value2
>      mycustomvariable = value3
> ```
> 
> ```
> $ git config --global --get-all customsection.mycustomvariable
> value1
> value2
> value3
> ```
> 
Previous: Kristoffer Haugsbakk
Message 4 of 4 in “Bug: Git Maintenance does not register multiple repos”
  1. Shubham KanodiaJun 20, 2024
  2. Kristoffer HaugsbakkJun 20, 2024
  3. Kristoffer HaugsbakkJun 21, 2024
  4. Phillip WoodJun 21, 2024

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.