Subject: Re: [RFC] Git config file reader in Perl (WIP)

From: Jakub Narebski <[email-masked]>
Date: Tue, 16 Jan 2007 15:14:47 +0100

Johannes Schindelin wrote:

> On Tue, 16 Jan 2007, Junio C Hamano wrote:
> 
>> "Nikolai Weibull" <[email-masked]> writes:
>> 
>>> If we're going down this slippery slope, why not just give up and add
>>> a --xml switch instead?  Readable by all...
>> 
>> Perhaps all except humans.
>> 
>> At least YAML, please...
> 
> I am _strongly_ opposed to all that rubbish. _If_ we want to use 
> repo-config to preformat the config variables, we should either
> 
> 1) just use "git repo-config -l" and STFU, or

> P.S.: The more I think about it, we should just use the output of 
> "repo-config -l".

It wouldn't work. Subsection and value are (almost) free form, and
they can contain '=' in them.

But I agree that XML is serious overkill...

> 2) introduce something like "--dump" which Eric implemented.

It would be probably best to introduce --dump which would output
config file _as if_ it was written by git-repo-config (probably
without comments).

All values would be in separate lines, there would be only one
section header per each section, values would be quoted if needed
(if they contain comment delimiter, '=' or whitespace).

E.g.

  [section "subsection"] key=a " b; " c; " d; "

would get rewritten as

  [section "subsection"]
  	key = "a  b;  c"

-- 
Jakub Narebski
Poland