From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS53758 23.128.96.0/24 X-Spam-Status: No, score=-11.5 required=3.0 tests=AWL,BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE,SPF_HELO_PASS,SPF_PASS, USER_IN_DEF_DKIM_WL shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by dcvr.yhbt.net (Postfix) with ESMTP id F35EE1F8C6 for ; Thu, 1 Jul 2021 08:19:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235184AbhGAIVb (ORCPT ); Thu, 1 Jul 2021 04:21:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35456 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235173AbhGAIVb (ORCPT ); Thu, 1 Jul 2021 04:21:31 -0400 Received: from mail-vs1-xe35.google.com (mail-vs1-xe35.google.com [IPv6:2607:f8b0:4864:20::e35]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1EDA8C061756 for ; Thu, 1 Jul 2021 01:19:00 -0700 (PDT) Received: by mail-vs1-xe35.google.com with SMTP id x12so3334170vsp.4 for ; Thu, 01 Jul 2021 01:19:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=KqGdjftGXyhKVB7dLAKX/1BDqGusInZ5MimjSG1GYNo=; b=jzq9gvv3kmOlT66JbJtrqHfIWPIDuiVlxe/zyhN70G99UDewF20GFhm9ArRGpVazq0 kkoQIj//VhfzcHTmIdRAbGfVAu7tL+dz3ROXRTVkK25mvLcb7N4ptMDOASpfKdi/yWQ4 +4/1J/qJeonEbSISGEWJodHwETk+ERELbbFlH7MYjdAVbT4VZ/CxDA6fyY5jzpYc52zs TKMlOMAdFIlMDGc8ZVeqE+BlXPM2c3AlEw9m+bx7JivlVAAcEJyLES4hugs+UA4qTges 96jSpDH+dAl93u07uzlq1aOQEd3nLxv7C3MrewHmtJJaFsFSerh9uJMFXWcBV9ejWoAL 6/sw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=KqGdjftGXyhKVB7dLAKX/1BDqGusInZ5MimjSG1GYNo=; b=AggfSYUZ0vdKzQ1at9jLRDCiaQovnhidalD8DaXo4YIElCB2Jm8D//eHwLSNJtHbgd tWKylctLhnc+6h8ZbRzkx4r3oAdTiF2kCkwLqmELitqUDu6j9UspqbY6gYisiEX30/sJ 8Iiq3J9t6hcjezF5CSN58uW4ABQcPHF0GnzsjKXifFaEUHfxFtFhQgPT7l20GHnMhyNW 72OVxtDZQnH54POOE4MnHE5quIiMSP1smQpejKDGw+MXS3m3T5JXfPoqmrPS8sNGCMPO l2HPGeAKkev4FeysrsqBZC7tiVwSNrfgIfSHQyBDosCRQHd5OFogrtDz1DLYYCBTOUCJ hXuw== X-Gm-Message-State: AOAM531FG7D4crGFFGzghxFOGx520/qnFKhNm4K/Es/wLj+U7GpqH9yi rEwd953Eggo/Ji4PHzXznJa523qfZsejlFr7uowCbw== X-Google-Smtp-Source: ABdhPJzbwYxWr+wAEyeS/Tqksxqm50DyH8D6ELDhLjnc8TwMGoU12rtVHZlKy2DRUN0G6LfUcuu2tcM2eZal5iZ5XNQ= X-Received: by 2002:a67:7fcf:: with SMTP id a198mr27700844vsd.50.1625127539127; Thu, 01 Jul 2021 01:18:59 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Han-Wen Nienhuys Date: Thu, 1 Jul 2021 10:18:48 +0200 Message-ID: Subject: Re: Structured (ie: json) output for query commands? To: Martin Langhoff Cc: Git Mailing List Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org On Wed, Jun 30, 2021 at 7:00 PM 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 co= oking). 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. --=20 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=C3=A4ftsf=C3=BChrer: Paul Manicle, Halimah DeLaine Prado