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

Re: [BUG] git config does not reuse section name

From
Junio C Hamano <gitster@pobox.com>
Date
Dec 8, 2009, 03:27 UTC
Message-ID
<7vy6lep2ly.fsf@alter.siamese.dyndns.org>
In-Reply-To
<alpine.DEB.1.00.0912080258010.4985@pacific.mpi-cbg.de>
Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
> IIRC, due to technical limitations, the config machinery only recognizes 
> sections if there is at least _one_ entry in them.  This is because 
> git_config() is used to determine (from the current file position) where 
> the section begins.

Ah, the reading side should be able to get by with that parsing logic, as an empty section is totally ignorable anyway. And the parser for the writing side reuses that logic. Asking for removal code to notice the empty section and remove it needs a bit of restructuring of the parsing logic as currently it doesn't even see an empty section.

Thanks---the explanation makes sense (I am not saying "it justifies it"; I only mean "it explains why the code behaves like that very well").

I think we have kept the original parsing structure since repo-config added the write support, and "fixing" the issue is not that urgent, but it would be nice to get it fixed. Perhaps somebody can find some time over the upcoming holidays ;-)

Previous: Johannes Schindelin
Message 7 of 7 in “[BUG] git config does not reuse section name”
  1. Yakup AkbayDec 7, 2009
  2. Junio C HamanoDec 7, 2009
  3. Sverre RabbelierDec 7, 2009
  4. Junio C HamanoDec 7, 2009
  5. Johannes SchindelinDec 8, 2009
  6. Johannes SchindelinDec 8, 2009
  7. Junio C HamanoDec 8, 2009

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.