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

Re: git config oddity

From
SRSverre Rabbelier <alturin@gmail.com>
Date
Jul 15, 2008, 15:29 UTC
Message-ID
<bd6139dc0807150829n2b3c88d7p18c203e93cd4e0c1@mail.gmail.com>
In-Reply-To
<alpine.DEB.1.00.0807151600170.8950@racer>

On Tue, Jul 15, 2008 at 5:02 PM, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:

Show 5 quoted lines
>> 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.

Ok, this makes sense :). I agree that I would be unhappily surprised if I found that git removed a section that I had put some comments in when I unset a variable.

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

Ah, unfortunate indeed. I'm not sure I understand why it does not see the existing header? I had a look at config.c but I couldn't really make out why it doesn't. Would it be difficult to add that?

-- 
Cheers,

Sverre Rabbelier
Previous: Johannes SchindelinNext: Johannes Schindelin
Message 3 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.