Re: More git status --porcelain lossage

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Eric Raymond
Date: Saturday, April 10, 2010 - 3:57 pm

Jakub Narebski <jnareb@gmail.com>:

Yes. But to my mind, the big win of JSON is that you can extend it without
breaking parsers looking for older versions - they just skip the new
fields and all is happy.

Jakub, you seem to know this, but other listmermbers may not: I've
recently re-engineered GPSD, a service daemon for watching geolocation
sensors, to report JSON objects up the socket to client apps.  The
benefits in clarity and extensibility of the protocol have been
*huge*.  Like, today I'm adding a reporting type for digital
compass/gyroscope sensors.


Yes, I know this dance.  Answer: one big JSON object, tagged by the
name of the output generator, and also *containing a version-stamp
field*.  Array of file status objects is another top-level member.

The point is: later, if we want to enrich the reporting format, we add
whatever fields we want and bump the version stamp.  Self-describing
goodness.  Python, Perl, JavaScript, and Emacs LISP clients win
especially big.  Slurping this into a native data structure is one
function call.

The more I think about this, the better I like it.
 

Yes. Perhaps there's some scope for reuse here after all.  GPSD has
well-tested code for uttering the JSON quote/escape conventions. 
The git project is welcome to it.
-- 
		<a href="http://www.catb.org/~esr/">Eric S. Raymond</a>
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
More git status --porcelain lossage, Eric Raymond, (Fri Apr 9, 12:06 pm)
Re: More git status --porcelain lossage, Eric Raymond, (Fri Apr 9, 12:09 pm)
Re: More git status --porcelain lossage, Jakub Narebski, (Fri Apr 9, 12:22 pm)
Re: More git status --porcelain lossage, Eric Raymond, (Fri Apr 9, 12:50 pm)
Re: More git status --porcelain lossage, Jeff King, (Fri Apr 9, 9:12 pm)
Re: More git status --porcelain lossage, Jeff King, (Fri Apr 9, 9:14 pm)
Re: More git status --porcelain lossage, Simon, (Sat Apr 10, 11:48 am)
Re: More git status --porcelain lossage, Jakub Narebski, (Sat Apr 10, 12:01 pm)
Re: More git status --porcelain lossage, Eric Raymond, (Sat Apr 10, 12:30 pm)
Re: More git status --porcelain lossage, Ævar Arnfjörð Bjarmason, (Sat Apr 10, 12:39 pm)
Re: More git status --porcelain lossage, Eric Raymond, (Sat Apr 10, 12:41 pm)
Re: More git status --porcelain lossage, Martin Langhoff, (Sat Apr 10, 1:31 pm)
Re: More git status --porcelain lossage, Jakub Narebski, (Sat Apr 10, 2:21 pm)
Re: More git status --porcelain lossage, Simon, (Sat Apr 10, 2:24 pm)
Re: More git status --porcelain lossage, Paolo Bonzini, (Sat Apr 10, 3:28 pm)
Re: More git status --porcelain lossage, Eric Raymond, (Sat Apr 10, 3:57 pm)
Re: More git status --porcelain lossage, Eric Raymond, (Sat Apr 10, 4:06 pm)
Re: More git status --porcelain lossage, David Aguilar, (Mon Apr 12, 10:02 pm)