Re: [RFC PATCH 1/1] json-writer: incorrect format specifier
- From
- Jeff Hostetler <git@jeffhostetler.com>
- Date
- Mar 27, 2018, 10:24 UTC
- Message-ID
- <d3fc60d1-2d8f-ec8c-cafe-f96547eff9ca@jeffhostetler.com>
- In-Reply-To
- <9512a1eb-2b9d-fda5-f2a5-c9f59dff972c@ramsayjones.plus.com>
On 3/26/2018 11:26 PM, Ramsay Jones wrote:
> On 26/03/18 18:04, Junio C Hamano wrote: >> Ramsay Jones <ramsay@ramsayjones.plus.com> writes:
[...]
Show 5 quoted lines
> I must confess to not having given any thought to the wider > implications of the code. I don't really know what this code > is going to be used for. [Although I did shudder when I read > some mention of a 'universal interchange format' - I still > have nightmares about XML :-D ]
[...]
My current goals are to add telemetry in a friendly way and have events written in JSON to some audit destination. Something like:
{ "argv":["./git","status"],
"pid":84941,
"exit-code":0,
"elapsed-time":0.011121,
"version":"2.16.2.5.g71445db.dirty",
... }Later, we could add a JSON formatter to a command like "status" and then do things like:
$ git status --json | python '... json.load ...'
and eliminate the need to write custom parsers for normal or porcelain formats. There are other commands that could be similarly adapted and save callers a lot of screen-scraping code. But that is later.
Thanks, Jeff