From: Han-Wen Nienhuys <hanwen@google.com>
To: Martin Langhoff <martin.langhoff@gmail.com>
Cc: Git Mailing List <git@vger.kernel.org>
Subject: Re: Structured (ie: json) output for query commands?
Date: Thu, 1 Jul 2021 10:18:48 +0200 [thread overview]
Message-ID: <CAFQ2z_MGJ7Qo5fq7bnwXi3m32iVeaC2WfdsKjRW0JO4Tq+M37Q@mail.gmail.com> (raw)
In-Reply-To: <CACPiFCLzsiUjx-vm-dcd=0E8HezMWkErPyS==OQ7OhaXqR6CUA@mail.gmail.com>
On Wed, Jun 30, 2021 at 7:00 PM Martin Langhoff
<martin.langhoff@gmail.com> 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
prev parent reply other threads:[~2021-07-01 8:19 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CACPiFC++fG-WL8uvTkiydf3wD8TY6dStVpuLcKA9cX_EnwoHGA@mail.gmail.com>
2021-06-30 17:00 ` Structured (ie: json) output for query commands? Martin Langhoff
2021-06-30 17:59 ` Jeff King
2021-06-30 18:20 ` Martin Langhoff
2021-07-01 15:47 ` Jeff King
2021-06-30 20:19 ` brian m. carlson
2021-06-30 23:27 ` Martin Langhoff
2021-07-01 16:00 ` Jeff King
2021-07-01 21:18 ` brian m. carlson
2021-07-01 21:48 ` Jeff King
2021-07-02 13:13 ` Ævar Arnfjörð Bjarmason
2021-07-01 8:18 ` Han-Wen Nienhuys [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAFQ2z_MGJ7Qo5fq7bnwXi3m32iVeaC2WfdsKjRW0JO4Tq+M37Q@mail.gmail.com \
--to=hanwen@google.com \
--cc=git@vger.kernel.org \
--cc=martin.langhoff@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).