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

Re: git config key bug or by design?

From
Jeff King <peff@peff.net>
Date
Nov 28, 2012, 20:21 UTC
Message-ID
<20121128202158.GB9249@sigill.intra.peff.net>
In-Reply-To
<20121128071147.188a869e@Indy>
On Wed, Nov 28, 2012 at 07:11:47AM -0500, Peter van der Does wrote:
Show 8 quoted lines
> I am writing a tool, it needs to store branch names in a separate config
> file.
> 
> It's clear git doesn't respect those values, hence my question. I
> understand how to work around the problem, I would just prefix the key.
> I was just wondering if it was by design, which I guess it is as the
> parsing of the file will die if the key starts with a non-alpha
> character.

In that case, I would definitely say to use some prefix section like "section.$branchname.key". That is how git stores per-branch information (e.g., branch.master.merge), and it was always designed to let there be arbitrary data in the "middle" section, whereas the section and key are restricted and case-insensitive.

So no, I do not recall "cannot start with number" as a specific design decision, but it is definitely a design decision that the section name would not allow arbitrary content.

-Peff
Previous: Peter van der Does
Message 4 of 4 in “git config key bug or by design?”
  1. Peter van der DoesNov 28, 2012
  2. Jeff KingNov 28, 2012
  3. Peter van der DoesNov 28, 2012
  4. Jeff KingNov 28, 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.