From: Jeff King <peff@peff.net>
To: milki <milki@rescomp.berkeley.edu>
Cc: git@vger.kernel.org
Subject: Re: git-config: case insensitivity for subsections
Date: Thu, 25 Aug 2011 16:58:49 -0400 [thread overview]
Message-ID: <20110825205849.GA10384@sigill.intra.peff.net> (raw)
In-Reply-To: <20110818063528.GH13342@hal.rescomp.berkeley.edu>
On Wed, Aug 17, 2011 at 11:35:28PM -0700, milki wrote:
> If I define [section.SUBSECTION] (aka, not all lowercase), I cannot
> use: git config section.SUBSECTION.option, but rather only git config
> section.subsection.option.
The way the config code works (both internally and via git-config), is
to read through the config files, convert each key into a canonical
format (downcasing the section and key, and either preserving the
case for the subsection in '[section "FOO"]' or downcasing it for
'[section.FOO]'), and then compare the result to the canonical version
of what you're looking for.
In other words, if you want to match section.SUBSECTION, you should
always ask for the canonical version "section.subsection.whatever".
We could try to be nicer and handle this automatically, but it's
nontrivial. When you say "git config foo.BAR.baz", we don't know if you
mean for "BAR" to be case-insensitive or not. So it would involve
carrying more information around about how the section header in the
config file was actually parsed. Not impossible, but it would involve
changing the internal git_config interface and tweaking a lot of code to
match.
Is there a reason that you can't use the canonical version in your "git
config" invocation? Or was it simply confusing that it didn't work? I'd
much prefer to document this limitation in git-config(1) than change the
code.
> Furthermore, If I also define a [section "SUBSECTION"], the two
> sections are not merged.
I'm not sure it makes sense to do so. I can see how:
[section.SUBSECTION]
and
[section.subsection]
should be merged. But isn't:
[section "SUBSECTION"]
conceptually a different section entirely?
Again, do you have a real-world use for this?
-Peff
next prev parent reply other threads:[~2011-08-25 20:58 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-18 6:35 git-config: case insensitivity for subsections milki
2011-08-25 20:58 ` Jeff King [this message]
2011-08-25 21:32 ` Junio C Hamano
2011-08-25 21:39 ` Jeff King
2011-08-25 21:57 ` milki
2011-08-29 0:50 ` Alex Vandiver
2011-08-29 5:42 ` milki
2011-08-29 15:58 ` Jeff King
2011-08-29 16:47 ` Alex Vandiver
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20110825205849.GA10384@sigill.intra.peff.net \
--to=peff@peff.net \
--cc=git@vger.kernel.org \
--cc=milki@rescomp.berkeley.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).