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: AS3215 2.6.0.0/16 X-Spam-Status: No, score=-3.2 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by dcvr.yhbt.net (Postfix) with ESMTP id A302D1F8C4 for ; Tue, 22 Mar 2022 10:55:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233707AbiCVK43 (ORCPT ); Tue, 22 Mar 2022 06:56:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54340 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231974AbiCVK41 (ORCPT ); Tue, 22 Mar 2022 06:56:27 -0400 Received: from mail-ej1-x631.google.com (mail-ej1-x631.google.com [IPv6:2a00:1450:4864:20::631]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CAB2239148 for ; Tue, 22 Mar 2022 03:55:00 -0700 (PDT) Received: by mail-ej1-x631.google.com with SMTP id qa43so35214983ejc.12 for ; Tue, 22 Mar 2022 03:55:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:references:user-agent:in-reply-to :message-id:mime-version:content-transfer-encoding; bh=jW/KkiY1aDDItXdDeWCye3hzZazjeySd+dTz2EO2GOI=; b=ida3/Badjwj3WlpRa5v5x2jDQxyIHsnplY3caLg07A7Nr9imyrIyr7iRZjLcafzuJV eryP/nvkjvh2M0Nflm52eSWstco5J8mUJoe1HKoGhtG0PfNiqG7Xf+F9f2wqvFHpMK6p IQoOpD8PKrMgG3RdfRXp62xyZaRqpql+27cgtbm5T0aTOv20UG77S+NT/NSCoE2/elDg A++vl13+RIQPDeDOSmXKyxEobW73DbbjiTpmY0Vy8EFJLJLSRkQd4VPNeRHEYxDBFPXu Qmx8yvATWFYUc36psciS91MIBuYcVw+c/XzFbZnFgLKqtVmBvLZ/omXCKD0vkSHS6Jtm 67Zg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:references:user-agent :in-reply-to:message-id:mime-version:content-transfer-encoding; bh=jW/KkiY1aDDItXdDeWCye3hzZazjeySd+dTz2EO2GOI=; b=XTlidCQYU0e+5X4h+dR1rVPE0GfqPctfp8I8uFr+ncQVzAjbdMeMjFbDK+57mEi20j +OQuony+mv/jhysYyOYt9BEaSWeW+x8DWVeeUBTJKTt14CEnCu51DiesSzgzh4xgI+Vv HwYY10/1h1irRZD7W3PTSI7J0/Cp2cf57OcjNYxAiWzpv4YiqK1HKtc7iKUH6eK6N/2v e29vd4sMqhvnNHZu4g1ZKiKpHSHXLUwrWKd1lCSg/M+NTVoqNXom3RXz9xmZwGKLbQ2d gWTnsm6z4Pd4F6WICogOHu++5n4RryqTYVqm3sNYNO2c6Pu2ybb/teVdJW/qAwDN02LP w/ew== X-Gm-Message-State: AOAM5324/2NKm8xElO6wxdFolTX7/fMyZyi4YT+thgKj5lf/GRfakh+y TXU7wuDnxiKwwO0dX1G/rW4n8mmumXsTaQ== X-Google-Smtp-Source: ABdhPJzXWEndvkOFZiWzJIu/rpWKydTP5sGu2JxWP41k6Un1pie1E6Xa5bdrX5fhl30jdVYqwCuejg== X-Received: by 2002:a17:906:2695:b0:6cf:e1b4:118b with SMTP id t21-20020a170906269500b006cfe1b4118bmr24535871ejc.348.1647946499196; Tue, 22 Mar 2022 03:54:59 -0700 (PDT) Received: from gmgdl (j120189.upc-j.chello.nl. [24.132.120.189]) by smtp.gmail.com with ESMTPSA id z21-20020a1709063a1500b006da6436819dsm8154444eje.173.2022.03.22.03.54.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Mar 2022 03:54:58 -0700 (PDT) Received: from avar by gmgdl with local (Exim 4.95) (envelope-from ) id 1nWcAE-000Iwb-51; Tue, 22 Mar 2022 11:54:58 +0100 From: =?utf-8?B?w4Z2YXIgQXJuZmrDtnLDsA==?= Bjarmason To: Christian Couder Cc: Jayati Shrivastava , Hariom verma , Git List Subject: Re: Having grep support the -o option Date: Tue, 22 Mar 2022 11:50:10 +0100 References: <87in9ucsbb.fsf@evledraar.gmail.com> <20220318220623.50528-1-gaurijove@gmail.com> <220319.86ee2yds2f.gmgdl@evledraar.gmail.com> <220319.86a6dlewyj.gmgdl@evledraar.gmail.com> User-agent: Debian GNU/Linux bookworm/sid; Emacs 27.1; mu4e 1.7.10 In-reply-to: Message-ID: <220322.86a6dintod.gmgdl@evledraar.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org On Tue, Mar 22 2022, Christian Couder wrote: > On Sun, Mar 20, 2022 at 8:14 PM Jayati Shrivastava = wrote: >> >> On Sat, Mar 19, 2022 at 9:49 PM =C3=86var Arnfj=C3=B6r=C3=B0 Bjarmason >> wrote: >> > >> > >> > One thing I'd *really* like to see is the bits of %(if) %(then) >> > etc. extracted from ref-filter.c into some general API other commands >> > could use with strbuf_expand() and friends. >> > >> > I.e. if you could in addition to the strbuf_expand() callback define >> > what verbs you support for "if" and the like, or have callbacks for >> > their comparison functions. >> > >> > Then have that machinery drive the whole format expansion, which >> > eventually would expand your %(some-custom-thing) via a callback. >> > >> > I.e. the whole "valid_atom" state machine in ref-filter.c. >> >> So, the end goal is to design a formatting API that can be used by any >> command that takes --format option? > > It might be nice if we get closer to this after your GSoC project, but > I don't think it should become the main goal of the GSoC. Agreed. FWIW this is off-list discussion between Jayati and myself which started with her asking (and this was omitted in the context that made it on list: [...] Infact, I'll be excited to work on anything you suggest even if its not related to the project, as it will help me get familiar with the codebase and the contribution process at Git. So that suggestion of mine of generalizing ref-filter.c wasn't meant to distract from the GSoC project, I understood her to be looking for suggestions for things to work on that were *not* part of the GSoC project. So I suggested that ref-filter.c task, which is orthagonal, but relates to some of the same code.