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

Re: git config oddity

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Jul 15, 2008, 15:02 UTC
Message-ID
<alpine.DEB.1.00.0807151600170.8950@racer>
In-Reply-To
<bd6139dc0807150744l78eb8d54ld167d3a9a5a600f@mail.gmail.com>
Hi,
On Tue, 15 Jul 2008, Sverre Rabbelier wrote:
> I noticed today that when unsetting the last value in a group git
> config leaves the empty group header.

That is on purpose. As .git/config was always meant as a user-editable file, you can put comments into that section. Or comment out some values.

So "git config" does not remove the section, even if no variable is there at the moment.

It is somewhat unfortunate that setting a variable does not find the section; the reason is that it sees sections only when a variable is set (to avoid having to do the parsing itself).

Hth, Dscho

Previous: Sverre RabbelierNext: Sverre Rabbelier
Message 2 of 5 in “git config oddity”
  1. Sverre RabbelierJul 15, 2008
  2. Johannes SchindelinJul 15, 2008
  3. Sverre RabbelierJul 15, 2008
  4. Johannes SchindelinJul 15, 2008
  5. Sverre RabbelierJul 15, 2008

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.