Re: [RFC] Git config file reader in Perl (WIP)
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Jan 16, 2007, 22:56 UTC
- Message-ID
- <Pine.LNX.4.63.0701162352400.22628@wbgn013.biozentrum.uni-wuerzburg.de>
- In-Reply-To
- <200701162337.32759.jnareb@gmail.com>
Hi,
On Tue, 16 Jan 2007, Jakub Narebski wrote:
Show 17 quoted lines
> Nikolai Weibull wrote: > > On 1/16/07, Jakub Narebski <jnareb@gmail.com> wrote: > > >> But I agree that XML is serious overkill... > > > > I don't know if it was clear from my first mail, but I wasn't > > suggesting --xml as a serious alternative. My point was that if we're > > going to go through all the fuss of adding all these switches for > > outputting the configuration file in some fixed format, why not go > > with one that at least is universal in some sense (not necessarily > > XML). And, as Johannes already pointed out, it's very disturbing > > having to dump a configuration file so that it is more easily read by > > other programs. That would suggest that the ini-based format for > > git's configuration file is suboptimal. > > No, ini-based, or rather ini-like format for git configuration > is nice,
Exactly.
> but I think git is too forgiving in accepting input. Examples: section > header and key/value pair in the same line, allowing multiple quotes in > in value part.
But this is nice to the user!
> Well, the idea I had was to have --dump switch to git-repo-config to > dump init file as if it was created by git-repo-config invocations, > without any hand editing (canonical format).
My point still stands: if you already parse the user-friendly format, why not dump a parse friendly format? If it weren't for those darn non-alnums in the keys, out put of "git repo-config -l" would be perfectly acceptable.
So, how about a "git repo-config --dump" which outputs a stream of NUL separated keys and values? This should be really easy to "parse", and there are no ambiguities: No key or value can contain a NUL.
Ciao, Dscho