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

From: Jakub Narebski <[email-masked]>
Date: Wed, 17 Jan 2007 15:00:32 +0100

Johannes Schindelin wrote:
> 
> On Wed, 17 Jan 2007, Jakub Narebski wrote:
> 
>> No key or value can contain "\n".
> 
> I just tried this:
> 
> 	$ cat > .git/config << EOF
> 	[section] key = "Hello\nWorld"
> 	EOF
> 	$ git-repo-config -l
> 	section.key=Hello
> 	World
> 
> So, values _can_ contain newlines.

Sorry, my mistake. I haven't noticed that your previous example
the error was "\w", not embedded newlines, and that embedded newlines
work.
 
>> With "\n" as separator you can simply rrturn NUL in the noval case.
> 
> Which would buy you what exactly? You can tell that the user did not say 
> "noval = true", but "noval". Great. But the _effect_ should be the same!
> 
> Anyway, I realize you don't like my solution, so I will just shut up.

I like your solution.

The only ambiguity is how to deal with '[section] noval' case. You
propose to treat it as if it was '[section] noval = true' for --dump,
and not as if it was '[section] noval = ' or '[section] noval = ""'.
Good. But this _has_ to be explained in documentation.

That said, I still think that having alternate parser for a format
is a good idea. Otherwise it is not a format, but "something that
parser parses".

BTW. it looks like C escape sequences are parsed, but not octal
escape sequences, nor no-op escaping other character.

-- 
Jakub Narebski
Poland