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 7:00 PM Martin Langhoff
<martin.langhoff@xxxxxxxxx> 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).

<unpopular opinion>

text parsing is fine if you're doing a one-off, but if it's anything
that needs to be just moderately complex, robust or long-lived,
writing a proper program is a better idea. I'd recommend either go-git
(single file programs can easily be run with "go run"), or Dulwhich
(no experience, though) in python.

-- 
Han-Wen Nienhuys - Google Munich
I work 80%. Don't expect answers from me on Fridays.
--

Google Germany GmbH, Erika-Mann-Strasse 33, 80636 Munich

Registergericht und -nummer: Hamburg, HRB 86891

Sitz der Gesellschaft: Hamburg

Geschäftsführer: Paul Manicle, Halimah DeLaine Prado




[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