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

Re: git-config: case insensitivity for subsections

From
Jeff King <peff@peff.net>
Date
Aug 29, 2011, 15:58 UTC
Message-ID
<20110829155819.GA756@sigill.intra.peff.net>
In-Reply-To
<20110829054240.GB94231@hal.rescomp.berkeley.edu>
On Sun, Aug 28, 2011 at 10:42:40PM -0700, milki wrote:
> A user gave me a link [1] to his git-config and I cannot correctly
> parse, for example, his alias.last.
> [...]
> [1] https://github.com/kergoth/homefiles/blob/master/.gitconfig#L67
Isn't his config somewhat broken?  It looks like this:
  last = "!f(){ since="$1"; shift; git lg --since=\"last $since\" "$@"; }; f"

Those interior double-quotes should all be backslash-escaped. I didn't check, but git should interpret this as:

  !f(){ since=$1; shift; git lg --since="last $since" $@; }; f

which is probably not quite what he wanted (the quotes around $1 were actually superfluous, but the ones around $@ are important).

That being said, I think it is intentional that the value is not just "a single double-quoted chunk" but rather could consist of several quoted (or unquoted) chunks concatenated together. What does your parser think of:

  [foo]
    bar = "foo"bar"baz"
It should be:
  $ git config foo.bar
  foobarbaz
-Peff
Previous: milkiNext: Alex Vandiver
Message 8 of 9 in “git-config: case insensitivity for subsections”
  1. milkiAug 18, 2011
  2. Jeff KingAug 25, 2011
  3. Junio C HamanoAug 25, 2011
  4. Jeff KingAug 25, 2011
  5. milkiAug 25, 2011
  6. Alex VandiverAug 29, 2011
  7. milkiAug 29, 2011
  8. Jeff KingAug 29, 2011
  9. Alex VandiverAug 29, 2011

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.