From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BB3B2C48BDF for ; Fri, 18 Jun 2021 17:05:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A3910613D1 for ; Fri, 18 Jun 2021 17:05:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236047AbhFRRIF (ORCPT ); Fri, 18 Jun 2021 13:08:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52698 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236046AbhFRRIE (ORCPT ); Fri, 18 Jun 2021 13:08:04 -0400 Received: from mail-ed1-x52e.google.com (mail-ed1-x52e.google.com [IPv6:2a00:1450:4864:20::52e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DEE41C061760 for ; Fri, 18 Jun 2021 10:05:54 -0700 (PDT) Received: by mail-ed1-x52e.google.com with SMTP id r7so9512949edv.12 for ; Fri, 18 Jun 2021 10:05:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to; bh=M2IfVjiG2KeaDdkeC1e95IJvR7oJdxqqqTveQA1/FMw=; b=U7PC9YbCHxNQszH+a1TrQlC7Xm9uimprcN7bCCHYvXYTFdh18jBXkav+FJM+jJ5a5W aRmMnhG/Su8veUjnVazcfoM2ndIYH7QdK2JvCv3xqtEZGYXkpUrUD2XWQaQT4Z1vlQT/ 83OUNuQPY1wIF3XmZDGzKeoGKzIH7Pi+fgUI4DPRgpSFJkdH+yJCvkptDTNB19Zl3L1o 5OA6qyoSQhIsNkOyaMupKlAIzBLkL7tZ0Mh1WCzf/i/bvMDVTwHaN7THZz4uNn3z8l7r n3JoWEGfMx/flzGGRxe07x0GhvLCzkwl/fS4Yu8kleIMd5gG/Gi/NnrRfDq8Byduw0K4 mjSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=M2IfVjiG2KeaDdkeC1e95IJvR7oJdxqqqTveQA1/FMw=; b=QhP51XRUIBjq6aRfKCfpDSh/KW5D5iTiTih9D6MyFixeJsl0gAGOn98okPcfNyIBSD jndJbwmIolK88fx288sk8/TVYIymfuFgx0YpmJ1WbPhFwNwxhnGOFVYgOrp1NiIDjPYq 9saw5QjNqyLkH2X+mbSDaicRF9gFQPVVTkslINarKBmIJyWoq3PD5+jV4bfb3k0kP8qZ vzweKYQwCwTc80zHLGtTElPejl1ruXPizdConvCWIkIw1OmxcxCMlbX2JdC6mmdZBTRX SRY5dABGVbckuMUATYyWW/x4/LccXzemeG8FxjY9mOEnmmqdBMKnDfBq4q+DvKOhNnSk ONAg== X-Gm-Message-State: AOAM530uSweJxdZKvq+50bqX8SzTdJFQcv7MRLqntWdTLohP54IDNDnQ Oec5OMzHfdiM3tFpvV6JDZw= X-Google-Smtp-Source: ABdhPJzPHaG2UJa7mgiksxtHeFgSXmZ/oyL7Qgc5cM9BFTl5PezK/qVI9tE4VR0efH455ILv2X51BQ== X-Received: by 2002:aa7:d3c2:: with SMTP id o2mr6470965edr.358.1624035953589; Fri, 18 Jun 2021 10:05:53 -0700 (PDT) Received: from szeder.dev (94-21-23-215.pool.digikabel.hu. [94.21.23.215]) by smtp.gmail.com with ESMTPSA id a22sm1234595ejv.67.2021.06.18.10.05.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Jun 2021 10:05:53 -0700 (PDT) Date: Fri, 18 Jun 2021 19:05:50 +0200 From: SZEDER =?utf-8?B?R8OhYm9y?= To: =?utf-8?B?w4Z2YXIgQXJuZmrDtnLDsA==?= Bjarmason Cc: git@vger.kernel.org, Junio C Hamano , Emily Shaffer , Jeff Hostetler , Johannes Schindelin , Felipe Contreras Subject: Re: [PATCH 3/3] hook-list.h: add a generated list of hooks, like config-list.h Message-ID: <20210618170550.GE6312@szeder.dev> References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org 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 > new file mode 100755 > index 0000000000..5a3f7f849c > --- /dev/null > +++ 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. > + chomp; > + @l[$.] = $_; > + push @h => $l[$. - 1] if /^~~~+$/s; > + END { > + print qq[\t"$_",\n] for sort @h; > + } > + ' + cat < + NULL, > +}; > +EOF > +} > + > +echo > +print_hook_list