git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Phillip Wood <phillip.wood123@gmail.com>
To: Kristoffer Haugsbakk <code@khaugsbakk.name>,
	Shubham Kanodia <shubham.kanodia10@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: Bug: Git Maintenance does not register multiple repos
Date: Fri, 21 Jun 2024 11:10:27 +0100	[thread overview]
Message-ID: <d0deaa08-2894-4e89-ba51-7bed8e785ef3@gmail.com> (raw)
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.

>> 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

> `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
> ```
> 


      reply	other threads:[~2024-06-21 10:10 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-20 13:15 Bug: Git Maintenance does not register multiple repos Shubham Kanodia
2024-06-20 13:54 ` Kristoffer Haugsbakk
     [not found]   ` <CAG=Um+1EyB08n7oH6rgqPmmn0OWndUdv4vEsY5Hcv3aaf-BHxg@mail.gmail.com>
2024-06-21  6:58     ` Kristoffer Haugsbakk
2024-06-21 10:10       ` Phillip Wood [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d0deaa08-2894-4e89-ba51-7bed8e785ef3@gmail.com \
    --to=phillip.wood123@gmail.com \
    --cc=code@khaugsbakk.name \
    --cc=git@vger.kernel.org \
    --cc=phillip.wood@dunelm.org.uk \
    --cc=shubham.kanodia10@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).