Re: Structured (ie: json) output for query commands?

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

 



On Wed, Jun 30, 2021 at 01:00:24PM -0400, Martin Langhoff wrote:

> I'm used to automating git by parsing stuff in Unix shell style. But
> the golden days that gave us Perl are well behind us.
> 
> Before I write (unreliable, leaky, likely buggy) text parsing bits one
> more time, has git grown formatted output? I'm aware of fmt and
> friends, I'm thinking of something that handles escaping, nested data
> structures, etc.
> 
> Something like "git shortlog --json".
> 
> Have there been discussions? Patches? (I don't spot anything in what's cooking).

It's been discussed off-and-on over the years, but I don't think
anybody's actively working on it.

The trace2 facility has some json output. That's probably not helpful
for what you're doing, but it does mean we have basic json output
routines available.

One complication we faced is that a lot of Git's data is bag-of-bytes,
not utf8. And json technically requires utf8. I don't remember if we
simply fudged that and output possibly non-utf8 sequences, or if we
actually encode them.

-Peff



[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