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" $@; }; fwhich 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