Re: More git status --porcelain lossage
From: Jakub Narebski <hidden>
Date: 2016-06-15 22:48:36
On Sat, 10 Apr 2010, Eric Raymond wrote:
Jakub Narebski [off-list ref]:quoted
I could understand providing JSON format, specified using --json option.You know, that's actually an interesting idea. I mentioned it previously as the not-XML if we want to build on a metaprotocol; I wasn't considering it seriously then. But I am now, and it is not without attractions. JSON would certainly solve all the delimiter and empty-object edge cases, and it has excellent extensibility.
It is a bit chatty, but is to some extent self documenting. The question is whether it should output well formed array of objects, or just list of objects not wrapped in array...
quoted
I think there is some GPLv2 compatibile JSON generating code in C (MIT licensed code is GPLv2 compatibilie, isn't it?); we can always borrow compact JSON generation code from GPSD project (if license allows it) from ESR.My license would allow it, but there's not really a lot of win in trying to reuse JSON generator code - writing your own printfs for it by hand is easy and fast.
What I am worrying about is correct handling of escaping, quoting, and non-ASCII characters in strings (the JSON-quoting and JSON-escapes are different than C escape codes, IIRC). JSON rules are simple, but are different than C. -- Jakub Narebski Poland