From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jim Porter Newsgroups: gmane.emacs.devel Subject: Re: New Git hooks for checking file names in commit messages Date: Sat, 22 Apr 2023 12:44:12 -0700 Message-ID: <7e41e8dc-2341-8435-7678-4e566d21c6b7@gmail.com> References: <5e494275-d253-118a-4a40-86d252285a23@gmail.com> <83pm7w30pg.fsf@gnu.org> <19cf70fa-22fc-213b-e2d3-610f8e6cc165@gmail.com> <838rek2w3g.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------951jHVWRmdgNmUW00FbB0qAT" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="2339"; mail-complaints-to="usenet@ciao.gmane.io" Cc: john@yates-sheets.org, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Apr 22 21:45:06 2023 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pqJAQ-0000Up-5W for ged-emacs-devel@m.gmane-mx.org; Sat, 22 Apr 2023 21:45:06 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pqJ9f-0001XB-HO; Sat, 22 Apr 2023 15:44:19 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pqJ9e-0001X2-Gi for emacs-devel@gnu.org; Sat, 22 Apr 2023 15:44:18 -0400 Original-Received: from mail-pl1-x630.google.com ([2607:f8b0:4864:20::630]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pqJ9c-0007R6-EQ; Sat, 22 Apr 2023 15:44:17 -0400 Original-Received: by mail-pl1-x630.google.com with SMTP id d9443c01a7336-1a68f2345c5so27293245ad.2; Sat, 22 Apr 2023 12:44:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1682192654; x=1684784654; h=in-reply-to:from:references:cc:to:content-language:subject :mime-version:date:message-id:from:to:cc:subject:date:message-id :reply-to; bh=gD0181pDf7NZKGeIs8f/p1NREqbsSd3ZRiIemUS1B/c=; b=A0xcevA+vfUaMGb6f/imP6XafZhBs4YGA5B3ymNYZ40aR46K88fjIcGIha5rOP71nk CisDlDQ9r6M2zNh5heho7n/W8yvPTqkE1BxJuikw+T81eLSGmtJNWDmjeGndRAgR++tG n8SPKGU5HuX1rlIGz2f17OwFycFLBLH/Gs+5kIj++ddkO7MnwqkFr2wyfE0VEnUkrsNO 8N4RixMtEX9TXOBuERZZ7Jy5xcEBk6IeTVRME/y+wbRynF6TE2JlFSt/1Pk/zbVpcfxA p47lKKX/mMc5iZ99KT3WCfkMYfo7+VklKrfoMk69mu3xmlWyrhJbBHOQfKhVAJm+4nzO Ef/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682192654; x=1684784654; h=in-reply-to:from:references:cc:to:content-language:subject :mime-version:date:message-id:x-gm-message-state:from:to:cc:subject :date:message-id:reply-to; bh=gD0181pDf7NZKGeIs8f/p1NREqbsSd3ZRiIemUS1B/c=; b=d/eJJF05+PYx5gQuxHwOpCAXeaMRf96MBzWEPhmIlpaI4RFZqPLS2xcu1DmG9lw+h/ BEA8yk9fqweCXP1tgAI4tK2cJsYT68tzWs3hK6NLnqlaXkTZ9LwbmnU30rWR52cuq2Ko ciMSHHd3zuTh2oy/3RHgQMmXUFI3E4ZRgdTXufLLs+Z2eEx1MaSeunSWT5i0kNwM7zZE 4PoQg8T15Fla/wmo2uEBYNF8OlnZHQZyPg4VNx9Zly+RsvQMtVOxsJzR9qh1oyw2JXr3 f+s7/YjJ00re/mWrCoZq7yFkwqOePhwe9JIBJbGznbazipqDS7bcqpXLFeiXdaa2DyoY AKmw== X-Gm-Message-State: AAQBX9dXD7+RaTMLwQ6+c+3Y1UB82kslqGaUw4gB5PRfhfyEeQfG86hv 3o/etbhEvfWpFSx4PkACNuTgW6vM1llDmg== X-Google-Smtp-Source: AKy350bnUyUph4j5jrvkzCOpwdK5VRR4SdofNK3LjMmyNhi0FNKp026JEUnxhaIn03O31JHy8yNOgQ== X-Received: by 2002:a17:903:11cd:b0:1a9:5e50:f20b with SMTP id q13-20020a17090311cd00b001a95e50f20bmr3154042plh.21.1682192653759; Sat, 22 Apr 2023 12:44:13 -0700 (PDT) Original-Received: from [192.168.1.2] (cpe-76-168-148-233.socal.res.rr.com. [76.168.148.233]) by smtp.googlemail.com with ESMTPSA id lk6-20020a17090b33c600b0024702e5dda0sm6117773pjb.39.2023.04.22.12.44.12 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 22 Apr 2023 12:44:13 -0700 (PDT) Content-Language: en-US In-Reply-To: <838rek2w3g.fsf@gnu.org> Received-SPF: pass client-ip=2607:f8b0:4864:20::630; envelope-from=jporterbugs@gmail.com; helo=mail-pl1-x630.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:305586 Archived-At: This is a multi-part message in MIME format. --------------951jHVWRmdgNmUW00FbB0qAT Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 4/22/2023 12:51 AM, Eli Zaretskii wrote: > The programmatic expression of the standards is in add-log.el, I > think. Thanks, that was helpful. From that, I see that you can list multiple files separated by commas and a space like so: * file1.txt, file2.txt add-log.el's font-lock doesn't allow lists of files like that to span multiple lines, but I think it's reasonable to support that in the hooks. Everything else about the entries can span multiple lines, after all. With add-log.el as a reference, I tightened up the Git hooks a bit so that they're stricter. They're still reasonably flexible though, e.g. it won't treat something like this as a file entry: * This is a bullet point. That will help reduce false positives so that committers can format the description of their commit fairly freely. Hopefully this is a good balance: the hooks are stricter than authors.el, but not so strict that reasonable (IMO) messages will be rejected. --------------951jHVWRmdgNmUW00FbB0qAT Content-Type: text/plain; charset=UTF-8; name="0001-Improve-the-logic-of-the-file-entry-Git-hooks-to-mat.patch" Content-Disposition: attachment; filename*0="0001-Improve-the-logic-of-the-file-entry-Git-hooks-to-mat.pa"; filename*1="tch" Content-Transfer-Encoding: base64 RnJvbSBmODZkZGYxY2VkNDg0ZjY3M2VhZGEwNzBmMzVkYTdkMDUyZTQzYjk5IE1vbiBTZXAg MTcgMDA6MDA6MDAgMjAwMQpGcm9tOiBKaW0gUG9ydGVyIDxqcG9ydGVyYnVnc0BnbWFpbC5j b20+CkRhdGU6IEZyaSwgMjEgQXByIDIwMjMgMTA6MDY6NDkgLTA3MDAKU3ViamVjdDogW1BB VENIXSBJbXByb3ZlIHRoZSBsb2dpYyBvZiB0aGUgZmlsZSBlbnRyeSBHaXQgaG9va3MgdG8g bWF0Y2gKIGFkbWluL2F1dGhvcnMuZWw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yBEZWxldGUgdGhlIGxlYWRp bmcgIioiIGFuZCBhbnkgdHJhaWxpbmcgaW5mb3JtYXRpb24uCisgICAgICBzdWIoL14oOyAp P1wqWyBcdF0rLywgIiIsIGZpbGVuYW1lc19zdHIpCisgICAgICBzdWIoL1tbKDw6XS4qJC8s ICIiLCBmaWxlbmFtZXNfc3RyKQorCisgICAgICAjIFRoZXJlIG1pZ2h0IGJlIG11bHRpcGxl IGZpbGVzIGxpc3RlZCBpbiB0aGlzIGVudHJ5LCBzZXBhcmF0ZWQKICAgICAgICMgYnkgc3Bh Y2VzIChhbmQgcG9zc2libHkgYSBjb21tYSkuICBJdGVyYXRlIG92ZXIgZWFjaCBvZiB0aGVt LgotICAgICAgc3BsaXQoc3Vic3RyKCQwLCBSU1RBUlQsIFJMRU5HVEgpLCBmaWxlbmFtZXMs ICIsPyhbWzpibGFuazpdXSt8JCkiKQotCisgICAgICBzcGxpdChmaWxlbmFtZXNfc3RyLCBm aWxlbmFtZXMsICIsWyBcdF0rIikKICAgICAgIGZvciAoaSBpbiBmaWxlbmFtZXMpIHsKICAg ICAgICAgIyBSZW1vdmUgdHJhaWxpbmcgc2xhc2hlcyBmcm9tIGFueSBkaXJlY3RvcnkgZW50 cmllcy4KICAgICAgICAgc3ViKC9cLyQvLCAiIiwgZmlsZW5hbWVzW2ldKQpAQCAtODMsNiAr OTYsOCBAQCBmdW5jdGlvbiBjaGVja19jb21taXRfbXNnX2ZpbGVzKGNvbW1pdF9zaGEsIHZl cmJvc2UsICAgIGNoYW5nZXMsIGdvb2QsIFwKICAgICAgICAgICBnb29kID0gMAogICAgICAg ICB9CiAgICAgICB9CisKKyAgICAgIGZpbGVuYW1lc19zdHIgPSAiIgogICAgIH0KICAgfQog ICBjbG9zZShjbWQpCi0tIAoyLjI1LjEKCg== --------------951jHVWRmdgNmUW00FbB0qAT--