Re: [RFC] Git config file reader in Perl (WIP)
- From
Jakub Narebski <jnareb@gmail.com>
- Date
- Jan 17, 2007, 14:00 UTC
- Message-ID
- <200701171500.33220.jnareb@gmail.com>
- In-Reply-To
- <Pine.LNX.4.63.0701171334410.22628@wbgn013.biozentrum.uni-wuerzburg.de>
Johannes Schindelin wrote:
Show 15 quoted lines
> > 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.
Show 6 quoted lines
>> 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