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

Use git-config to Break your Config File

From
David E. Wheeler <david@justatheory.com>
Date
Apr 24, 2012, 02:57 UTC
Message-ID
<9E01F5E2-FB51-418D-B50C-EB6DC63A4F84@justatheory.com>
Gitsters,
I was fooling around and realized that I could assign an empty string as the name of a config section, like so:
    $ git config --rename-section my ''
This leaves the config file looking like this:
    []
        foo = goodbye
Which does not appear to be valid:
    $ git config --get '.foo'          
    fatal: bad config file line 13 in .git/config
So maybe git-config should disallow setting a section to an empty string?
Best,
David
Next: Jeff King
Message 1 of 3 in “Use git-config to Break your Config File”
  1. David E. WheelerApr 24, 2012
  2. config: reject bogus section names for --rename-sectionJeff King, Apr 26, 2012
  3. Junio C HamanoApr 26, 2012

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.