* git config key bug or by design?
@ 2012-11-28 2:57 Peter van der Does
0 siblings, 0 replies; 5+ messages in thread
From: Peter van der Does @ 2012-11-28 2:57 UTC (permalink / raw)
To: git
I noticed today I can't create a key starting with a number.
The source code[1] confirms this, but is this a bug or is it by design?
[1]: https://github.com/git/git/blob/master/config.c#L1265
--
Peter van der Does
GPG key: CB317D6E
IRC: Ganseki on irc.freenode.net
Twitter: @petervanderdoes
^ permalink raw reply [flat|nested] 5+ messages in thread
* git config key bug or by design?
@ 2012-11-28 3:14 Peter van der Does
2012-11-28 3:34 ` Jeff King
0 siblings, 1 reply; 5+ messages in thread
From: Peter van der Does @ 2012-11-28 3:14 UTC (permalink / raw)
To: git
I noticed today I can't create a key starting with a number.
The source code[1] confirms this, but is this a bug or is it by design?
[1]: https://github.com/git/git/blob/master/config.c#L1265
--
Peter van der Does
GPG key: CB317D6E
IRC: Ganseki on irc.freenode.net
Twitter: @petervanderdoes
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: git config key bug or by design?
2012-11-28 3:14 git config key bug or by design? Peter van der Does
@ 2012-11-28 3:34 ` Jeff King
2012-11-28 12:11 ` Peter van der Does
0 siblings, 1 reply; 5+ messages in thread
From: Jeff King @ 2012-11-28 3:34 UTC (permalink / raw)
To: Peter van der Does; +Cc: git
On Tue, Nov 27, 2012 at 10:14:46PM -0500, Peter van der Does wrote:
> I noticed today I can't create a key starting with a number.
>
> The source code[1] confirms this, but is this a bug or is it by design?
I don't recall ever discussing it. But what is it that you want to store
in a key starting with a number? Git does not respect any such config
values[1].
Are you writing a new tool that will store its config alongside git's?
Even if the behavior is loosened, you would probably want to avoid
starting your config keys with numbers, as older git versions would be
around for a while and would choke on it.
-Peff
[1] You can still store arbitrary bytes in the subsection name (e.g.,
"foo.123.bar").
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: git config key bug or by design?
2012-11-28 3:34 ` Jeff King
@ 2012-11-28 12:11 ` Peter van der Does
2012-11-28 20:21 ` Jeff King
0 siblings, 1 reply; 5+ messages in thread
From: Peter van der Does @ 2012-11-28 12:11 UTC (permalink / raw)
To: git
On Tue, 27 Nov 2012 22:34:09 -0500
Jeff King <peff@peff.net> wrote:
>
> I don't recall ever discussing it. But what is it that you want to
> store in a key starting with a number? Git does not respect any such
> config values[1].
>
> Are you writing a new tool that will store its config alongside git's?
> Even if the behavior is loosened, you would probably want to avoid
> starting your config keys with numbers, as older git versions would be
> around for a while and would choke on it.
>
> -Peff
>
> [1] You can still store arbitrary bytes in the subsection name (e.g.,
> "foo.123.bar").
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.
--
Peter van der Does
GPG key: CB317D6E
IRC: Ganseki on irc.freenode.net
Twitter: @petervanderdoes
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: git config key bug or by design?
2012-11-28 12:11 ` Peter van der Does
@ 2012-11-28 20:21 ` Jeff King
0 siblings, 0 replies; 5+ messages in thread
From: Jeff King @ 2012-11-28 20:21 UTC (permalink / raw)
To: Peter van der Does; +Cc: git
On Wed, Nov 28, 2012 at 07:11:47AM -0500, Peter van der Does wrote:
> 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
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2012-11-28 20:22 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-28 3:14 git config key bug or by design? Peter van der Does
2012-11-28 3:34 ` Jeff King
2012-11-28 12:11 ` Peter van der Does
2012-11-28 20:21 ` Jeff King
-- strict thread matches above, loose matches on Subject: below --
2012-11-28 2:57 Peter van der Does
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).