Re: Pretty output in JSON format

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



"brian m. carlson" <sandals@xxxxxxxxxxxxxxxxxxxx> writes:

> On 2024-09-24 at 21:52:35, Ron Ziroby Romero wrote:
>> What do y'all think?
>
> I think this is ultimately a bad idea.  JSON requires that the output be
> UTF-8, but Git processes a large amount of data, including file names,
> ref names, commit messages, author and committer identities, diff
> output, and other file contents, that are not restricted to UTF-8.

This strikes me with a little bit of 'perfect as the enemy of good'
here. I'm sure there are ways to signal an encoding failure. I would,
however, caution against trying to provide diff output in JSON. That
just seems... odd. Maybe base64 it first? (I don't know -- I just
struggle to see the use-case here.)

> However, if you were interested in CBOR output, which isn't
> human-readable but is capable of handling byte strings, then I don't
> see a problem. CBOR is used in FIDO2 and a variety of other protocols
> and is interoperable, so it should be a fine choice here.

CBOR would certainly solve the byte stream problem, but I think it would
primarily be only useful for 'serious' toolsmiths that need to handle
wildly unpredictable data. For most uses, JSON would get the job done.

>> What do y'all think?
As with all things, I'd suggest you draw up a more formal proposal of
exactly how this would work, and then that proposal can be discussed.
How would you use this option? What would its behavior be? What's in
scope? What's _not_ in scope? :-)

-- 
Sean Allred




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux