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=-4.1 required=3.0 tests=AWL,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_LOW, SPF_HELO_PASS,SPF_PASS 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 36FF31F5AE for ; Fri, 18 Jun 2021 17:51:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234469AbhFRRxI convert rfc822-to-8bit (ORCPT ); Fri, 18 Jun 2021 13:53:08 -0400 Received: from mail-ed1-f51.google.com ([209.85.208.51]:38536 "EHLO mail-ed1-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233642AbhFRRxH (ORCPT ); Fri, 18 Jun 2021 13:53:07 -0400 Received: by mail-ed1-f51.google.com with SMTP id t7so9711761edd.5 for ; Fri, 18 Jun 2021 10:50:56 -0700 (PDT) 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=2mqZ44vjb55aiQVHr/RoY6Ulvc5xlX2DR9y2XqGdsio=; b=QahbGidF2Cbc7hxwHRqaq8UYdZo7RkhcdsKiOGq3S6+cqP0pnH+Y6HjcyeZiFlAcm1 S2CXKp0OO6Uh6UzHG9RPxpgnqktwTKKisYOGJ48WJGrlhXVaFa0v2HOYCPZZy1RqFdRr VRsuyn+uWzqZJ8byycc7YiK6WGWlPqg4kOH1QnyzBVtNJeEyQQEsvVQKgC5Wu3FXFJIA uvakMK7BQQkrErUzVujAyMzflOKjj7jxIpyzUmsaJIbL5xFCYHvx52KlV7rlWdIx8fPS x/Z6P+qOpNEtYz/1MpOePylCD2TUjzMIHfADzdYHfTBoIHFgRCMTbOpAzYXDaOJMXReX X/tA== X-Gm-Message-State: AOAM533zmhSXNDOlGHL6QZxUKNChhNo06+2m9jZ4EJL3/rTcLhN9nBw0 KfP1014zFBy1X+iKHdtfysG6ypEGx7Pj6vO3M80= X-Google-Smtp-Source: ABdhPJwqH3SMk9oSMbOkoQ26grI0eQSvGNRe5aCwt6F+2Dx/TiV8azZFwMiL9OmTiICs558Ihfr73QK1wQADpezyMoo= X-Received: by 2002:a05:6402:11c9:: with SMTP id j9mr6784510edw.89.1624038655649; Fri, 18 Jun 2021 10:50:55 -0700 (PDT) MIME-Version: 1.0 References: <20210618170550.GE6312@szeder.dev> In-Reply-To: <20210618170550.GE6312@szeder.dev> From: Eric Sunshine Date: Fri, 18 Jun 2021 13:50:44 -0400 Message-ID: Subject: Re: [PATCH 3/3] hook-list.h: add a generated list of hooks, like config-list.h To: =?UTF-8?Q?SZEDER_G=C3=A1bor?= Cc: =?UTF-8?B?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= , Git List , Junio C Hamano , Emily Shaffer , Jeff Hostetler , Johannes Schindelin , Felipe Contreras Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org On Fri, Jun 18, 2021 at 1:06 PM SZEDER Gábor wrote: > On Thu, Jun 17, 2021 at 12:09:36PM +0200, Ævar Arnfjörð Bjarmason wrote: > > diff --git a/generate-hooklist.sh b/generate-hooklist.sh > > @@ -0,0 +1,24 @@ > > +#!/bin/sh > > + > > +echo "/* Automatically generated by generate-hooklist.sh */" > > + > > +print_hook_list () { > > + cat < > +static const char *hook_name_list[] = { > > +EOF > > + perl -ne ' > > Why Perl? > > At the moment I can run 'make' and get a functioning git even when > Perl is not installed. With this patch that wouldn't work anymore. > > Both 'generate-cmdlist.sh' and 'generate-configlist.sh' can process > the documentation into a header file with a long list in it without > resorting to Perl; I'm sure that hooks could be processed without Perl > as well. That's a good point and not an idle question. It wasn't all that long ago that I rewrote `generate-cmdlist` in Perl and got a complaint that the Git project was no longer buildable on FreeBSD[1], with the result that I ended up re-implementing it (again) in shell[2]. [1]: https://lore.kernel.org/git/loom.20150814T171757-901@post.gmane.org/ [2]: https://lore.kernel.org/git/1440365469-9928-1-git-send-email-sunshine@sunshineco.com/