Re: [RFC] Git config file reader in Perl (WIP)
- From
Jakub Narebski <jnareb@gmail.com>
- Date
- Jan 15, 2007, 16:00 UTC
- Message-ID
- <200701151700.48159.jnareb@gmail.com>
- In-Reply-To
- <dbfc82860701150734j7322de15v30dc6822b456ea66@mail.gmail.com>
Nikolai Weibull wrote:
Show 19 quoted lines
> On 1/15/07, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote: >> On Mon, 15 Jan 2007, Eric Wong wrote: > >>>> Would you write "git repo-config --perl", then? ;-) > >>> The below patch should be a start (only tested on my fairly standard >>> .git/config). A --python option should be easy, too :) > >> A bit shorter (and gets the booleans right, plus being even easier >> towards --python extension): > > If we're going down this slippery slope, why not just give up and add > a --xml switch instead? Readable by all and a lot more flexible than > --perl, --python, --ruby, --tcl, --sh, --c++, --fortran, --lisp, > --html, --that-next-silver-bullet-language [...]. > > That said, parsing the config file as-is can't be so difficult that we > need to export it to separate files with a different syntax, now can > it?
Parsing the config file is not _that_ difficult (the first post in this thread had config reader in Perl), but it is not that easy: case (in)setiviness, quoting, escaping, comments, removing leading and trailing whitespace when not quoted...
P.S. I'd rather have an additional implementation (in Perl) conforming to yet to be written git ini-like config file specs, to find places where canonic parser, git-repo-config, doesn't conform to the specs.
-- Jakub Narebski Poland