git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: More git status --porcelain lossage

From
Jakub Narebski <jnareb@gmail.com>
Date
Apr 10, 2010, 21:21 UTC
Message-ID
<201004102321.59263.jnareb@gmail.com>
In-Reply-To
<20100410194154.GB28768@thyrsus.com>
On Sat, 10 Apr 2010, Eric Raymond wrote:
Show 10 quoted lines
> Jakub Narebski <jnareb@gmail.com>:
>  
> > 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...

Show 8 quoted lines
> >    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
Previous: David AguilarNext: Eric Raymond
Message 14 of 18 in “More git status --porcelain lossage”
  1. Eric RaymondApr 9, 2010
  2. Eric RaymondApr 9, 2010
  3. Jakub NarebskiApr 9, 2010
  4. Eric RaymondApr 9, 2010
  5. Jeff KingApr 10, 2010
  6. Jeff KingApr 10, 2010
  7. SimonApr 10, 2010
  8. Jakub NarebskiApr 10, 2010
  9. Eric RaymondApr 10, 2010
  10. Martin LanghoffApr 10, 2010
  11. Paolo BonziniApr 10, 2010
  12. Eric RaymondApr 10, 2010
  13. David AguilarApr 11, 2010
  14. Jakub NarebskiApr 10, 2010
  15. Eric RaymondApr 10, 2010
  16. Eric RaymondApr 10, 2010
  17. Ævar Arnfjörð BjarmasonApr 10, 2010
  18. SimonApr 10, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.