Re: Unresolved issues #2
- From
Linus Torvalds <torvalds@osdl.org>
- Date
- May 6, 2006, 21:51 UTC
- Message-ID
- <Pine.LNX.4.64.0605061442490.16343@g5.osdl.org>
- In-Reply-To
- <Pine.LNX.4.63.0605062332420.6423@wbgn013.biozentrum.uni-wuerzburg.de>
On Sat, 6 May 2006, Johannes Schindelin wrote:
> > It was done because the very syntax of the config suggests it be a > user-editable file.
Yeah, I personally much prefer user-friendly config files. Any format that thinks that "easy parsing" is more important than "visually obvious" is bad. So I obviously think that XML is a horrid piece of cr*p (has anybody ever noticed I have strong opinions?) and totally unreadable.
I think "git repo-config" is doing a reasonable job of editing a file that is really designed to be user-friendly. That said, the code _is_ a bit scary.
It might be worthwhile to re-write config.c to read the config file into memory and work on it in-memory instead of doing the funky mixed usage (using fgetc/ftell to read it, but then switching over to mmap when rewriting it).
IOW, maybe that "static FILE *config_file" should be changed to something more like "static const char *config_buffer; unsigned int len;" instead, and at least make both the reading and writing use the same buffer rather than mixing stdio and mmap..
Linus