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=-3.7 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,RCVD_IN_DNSWL_MED, 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 84CFD1F8C8 for ; Mon, 27 Sep 2021 10:37:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233828AbhI0KjU (ORCPT ); Mon, 27 Sep 2021 06:39:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59650 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233787AbhI0KjT (ORCPT ); Mon, 27 Sep 2021 06:39:19 -0400 Received: from mail-ed1-x533.google.com (mail-ed1-x533.google.com [IPv6:2a00:1450:4864:20::533]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2F0AEC061575 for ; Mon, 27 Sep 2021 03:37:42 -0700 (PDT) Received: by mail-ed1-x533.google.com with SMTP id y35so16163676ede.3 for ; Mon, 27 Sep 2021 03:37:42 -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=Vni2glJPLNX8eOEA9GH/1FrNB+ZBdEZNy5EVyYhznt4=; b=bNJuUe0iCXz8IP4dLHLfhdbGa8L9P+DS9G5tx7NC0LEpG+IwoV7aqnZoFxpefZ5UrV YQbJh6iaLjBjTOIGa7TlROaWQXxub/LV2jXFsRQnse7h1/FhPJyZFn16/eu7INxtjqKc 5LuzGiookT6iUU0y3kq8+DYgXmmPFuzO6t/BbpuU5KADxGuFGQ0cSiUBm315/qgXNtXY vYmGcHWyhx9CLjeZ4sd8K765hktERRNot83crzQEnLDyTHwWtSy4/OuNIRdTTUG8uEmH g5LJNtYwoNq/1A8hAdVkGDX7144G/K32mgqb4EhhkqHchdRUpsM8RXMgOwqPb/ptg1O4 nfFg== 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=Vni2glJPLNX8eOEA9GH/1FrNB+ZBdEZNy5EVyYhznt4=; b=PzL5BxynayoIdsyZn0vcwrQ/pitY+OICjzJKAva10fKeiVjwuzfVR+M5Oy6TnJOfJl 1P0oJnUfmPeNRFBQVNuV4CNf8E1+LR0GGHquKrZvyNMzZVxJmYVUiU2eEtTYkErZvKU5 OgodB/eXFG+OXk/eFkaOcA2UUJEUTKe0OVeU1vdZ85uL9kbzmP1UoDk2Jsb/JyToxwe4 Pfn6PbN2CpYts3Lvz/aj4Z97oDiNjP5nKJEptJnx+cX95JHuhWnvM9J8rARFegMA+WUP ZH2Hd/WDJMT3LsQIIcUD9It73sB4Hj8HWRYchysOq6UzD1s6GdntqceZ5k0rwcCLv4Sv kJMg== X-Gm-Message-State: AOAM532Lc35Mejer9lBdCt1U94pXVej05fj5yzHmvxIV2rvPGe3L6WI/ ia9PU395ta+ZhmK6j2kCsnY= X-Google-Smtp-Source: ABdhPJwrzKPVQ3ctVUO168Fllb8gg2qHYRGHCQ+lKsF0rohGir6u4mpeFFE6Bq4U32FnHXvUwcHgxQ== X-Received: by 2002:a50:e0c3:: with SMTP id j3mr22404113edl.60.1632739060666; Mon, 27 Sep 2021 03:37:40 -0700 (PDT) Received: from evledraar (j120189.upc-j.chello.nl. [24.132.120.189]) by smtp.gmail.com with ESMTPSA id z4sm2893941edb.16.2021.09.27.03.37.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Sep 2021 03:37:40 -0700 (PDT) From: =?utf-8?B?w4Z2YXIgQXJuZmrDtnLDsA==?= Bjarmason To: phillip.wood@dunelm.org.uk Cc: git@vger.kernel.org, Junio C Hamano , Emily Shaffer , Jeff King , =?utf-8?Q?Ren=C3=A9?= Scharfe Subject: Re: [PATCH 8/8] hook-list.h: add a generated list of hooks, like config-list.h Date: Mon, 27 Sep 2021 12:36:32 +0200 References: <92471ff9-7573-c3e4-e9fd-63a5cbf5738f@gmail.com> <87fstt3gzd.fsf@evledraar.gmail.com> User-agent: Debian GNU/Linux bookworm/sid; Emacs 27.1; mu4e 1.7.0 In-reply-to: Message-ID: <87tui61ez0.fsf@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 Mon, Sep 27 2021, Phillip Wood wrote: > On 24/09/2021 20:30, =C3=86var Arnfj=C3=B6r=C3=B0 Bjarmason wrote: >> On Fri, Sep 24 2021, Phillip Wood wrote: >>=20 >>> Hi =C3=86var >>> On 23/09/2021 11:30, =C3=86var Arnfj=C3=B6r=C3=B0 Bjarmason wrote: >>>> diff --git a/generate-hooklist.sh b/generate-hooklist.sh >>>> new file mode 100755 >>>> index 00000000000..6d4e56d1a31 >>>> --- /dev/null >>>> +++ b/generate-hooklist.sh >>>> @@ -0,0 +1,18 @@ >>>> +#!/bin/sh >>>> +# >>>> +# Usage: ./generate-hooklist.sh >hook-list.h >>>> + >>>> +cat <>>> +/* Automatically generated by generate-hooklist.sh */ >>>> + >>>> +static const char *hook_name_list[] =3D { >>>> +EOF >>>> + >>>> +sed -n -e '/^~~~~*$/ {x; s/^.*$/ "&",/; p;}; x' \ >>> >>> POSIX does not support using a semicolon after a closing brace [1], >>> grepping our code base with >>> git grep 'sed .*};' '*.sh' >>> does not give any matches so I don't think we're using that pattern >>> any where else. Replacing the semicolon with ' -e' would fix it. >>> >>> Best Wishes >>> >>> Phillip >> Does this fail on any system you're aware of? If so what OS/version >> (and >> preferably version of "sed"). > > I'm not aware of any such system but I rarely use anything other than > linux. As this departure from POSIX is not already in the code base I=20 > thought it was worth flagging it. I did wonder if it would be > supported by the various BSDs but you testing shows it is actually > quite widely supported. > > Best Wishes > > Phillip Thanks, I completely agree that it's worth changing either way (as I did in my v2). I just wondered if it was a careful reading of the standard or having run into it on a system in the wild, in that case I'd try to test on that system in the future. Good eyes :)