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

RE: how exactly can git config section names contain periods?

From
Randall S. Becker <rsbecker@nexbridge.com>
Date
Jun 1, 2018, 20:50 UTC
Message-ID
<00ce01d3f9ea$270a0d30$751e2790$@nexbridge.com>
In-Reply-To
<alpine.LFD.2.21.1806011606490.11215@localhost.localdomain>
Show 11 quoted lines
> -----Original Message-----
> From: git-owner@vger.kernel.org <git-owner@vger.kernel.org> On Behalf
> Of Robert P. J. Day
> Sent: June 1, 2018 4:14 PM
> To: Git Mailing list <git@vger.kernel.org>
> Subject: how exactly can git config section names contain periods?
> 
> 
>   more oddities in my travels, this from Doc.../config.txt:
> 
> "The file consists of sections and variables.  A section begins with the
name
> of the section in square brackets and continues until the next section
begins.
> Section names are case-insensitive.  Only alphanumeric characters, `-` and
`.`
Show 6 quoted lines
> are allowed in section names.
>                                   ^ ?????
> 
>   what? how can section names contain periods? reading further,
> 
> "Sections can be further divided into subsections.  To begin a subsection
put
> its name in double quotes, separated by space from the section name, in
the
Show 7 quoted lines
> section header, like in the example below:
> 
> --------
>         [section "subsection"]
> 
> 
>   ok, so how on earth would i use "git config" at the command line to set
a
Show 10 quoted lines
> config variable with some arbitrary level of subsections? let's try this:
> 
>   $ git config --global a.b.c.d.e rday
> 
> huh ... seemed to work fine, and added this to my ~/.gitconfig:
> 
>   [a "b.c.d"]
>           e = rday
> 
> as i see it, the first component is intgerpreted as the section name, the
last
> component is the variable/key(?) name, and everything in between is
> treated as subsection(s), which is not at all obvious from that Doc file,
or from
> "man git-config".
> 
>   and if a section name can contain periods, how would you specify that at
the
> command line?

I'm with Robert on this. I would have thought that the interpretation should have been:

["a.b.c.d"]
         e = rday
Confused as well,
Randall
-- Brief whoami:
 NonStop developer since approximately 211288444200000000
 UNIX developer since approximately 421664400
-- In my real life, I talk too much.
Previous: Robert P. J. DayNext: Jeff King
Message 2 of 13 in “how exactly can git config section names contain periods?”
  1. Robert P. J. DayJun 1, 2018
  2. Randall S. BeckerJun 1, 2018
  3. Jeff KingJun 1, 2018
  4. Robert P. J. DayJun 1, 2018
  5. Junio C HamanoJun 1, 2018
  6. Jeff KingJun 2, 2018
  7. Robert P. J. DayJun 2, 2018
  8. Jeff KingJun 2, 2018
  9. Robert P. J. DayJun 3, 2018
  10. SZEDER GáborJun 3, 2018
  11. Robert P. J. DayJun 3, 2018
  12. Jeff KingJun 4, 2018
  13. Johannes SixtJun 3, 2018

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.