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: Fri, 21 Apr 2023 23:59:33 -0700 Message-ID: <19cf70fa-22fc-213b-e2d3-610f8e6cc165@gmail.com> References: <5e494275-d253-118a-4a40-86d252285a23@gmail.com> <83pm7w30pg.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="16645"; 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 09:00:03 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 1pq7E3-00047s-Oa for ged-emacs-devel@m.gmane-mx.org; Sat, 22 Apr 2023 09:00:03 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pq7Df-0003jo-NE; Sat, 22 Apr 2023 02:59:39 -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 1pq7De-0003jS-7Q for emacs-devel@gnu.org; Sat, 22 Apr 2023 02:59:38 -0400 Original-Received: from mail-pf1-x42e.google.com ([2607:f8b0:4864:20::42e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pq7Dc-0003xR-FK; Sat, 22 Apr 2023 02:59:37 -0400 Original-Received: by mail-pf1-x42e.google.com with SMTP id d2e1a72fcca58-63b67a26069so4041266b3a.0; Fri, 21 Apr 2023 23:59:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1682146774; x=1684738774; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:mime-version:date:message-id:from:to:cc :subject:date:message-id:reply-to; bh=M7Tf+KGJDBX8eiSqKbJCRBi92opSrXso28k6buTHRd0=; b=UB6bDkWIgZPMKFbm+PNTl9yl2qmPDVkyezYA5dvd/fdi3sDlKf9NszTZBobKuTY5WB N5yW+5/cxdmcNTkJgSuEcnHyyXw6oMUaH5Jdi4Wj1HKtC7bqo+9bouR3td2Qti2vT2dj apaa9Hek1u+DLPRTcxh+TZ41Mj9luGvXbZoWhYu3PsmsZSbkYdHQgZObxeoUpxTiZI6B cT9pzhuo529olw0vuiCwTfZ6hG/N/DPoyD2lcAhYVFGYscwUz2G8gKOyS8vYiseNUYim SnktU3+aVhsIZBjRgGPDRbjtwcXuhZSQQGf2Vj76Rjjz7qWYN+xVktAXY3eIyfUpS5ef H4dQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682146774; x=1684738774; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=M7Tf+KGJDBX8eiSqKbJCRBi92opSrXso28k6buTHRd0=; b=KLnzAvP5VeQNruVUvr5/f/2OYsG7A0U92TK524IWVXvorUAS79oEFJ1ZWNiAS/EAZ6 3TDSoxfYBwRj6JwQBrdagwQW7EqeYePB2hFNaGxNw5yqtfBmOZ6nyndmJFtslRy4sFw7 UqQ/WQObxLIF4A9HcPAdyFh0bdJ4uVgG3rcV0aM2daLZGbMwnl0mu9a88whjLKp1J89F UfgMvdP/V8G4EtUNHe6F6fcgKDsy3SjYIHqVZDSlEPkCrQ67Q4yVhjFpVUMwwaT/xO+C lqBRj/DZ9sLuCUAkrGpZ56wjo8jZMi1tjUFgfC/ZlT/FNoXR4uDdY0A/qKYGVUe5XeZ5 SU3A== X-Gm-Message-State: AAQBX9dJXMws0884ezFOS9ejF+LmBgeOVf6t3mKMvp5J+iDSThpHCSl5 GAvJ90QhaNAiwnw4ZQsq28s41acFhaeuuQ== X-Google-Smtp-Source: AKy350bSuJ5Zs77Zp0Hx6ckiBs954QhDUMuou/UDyNwQGkDzt08jebj7ybzaaDvW2ERMNnKMcibmaA== X-Received: by 2002:a05:6a21:328c:b0:f2:ea8e:b130 with SMTP id yt12-20020a056a21328c00b000f2ea8eb130mr2181959pzb.62.1682146773662; Fri, 21 Apr 2023 23:59:33 -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 r78-20020a632b51000000b00520f316ebe3sm3407649pgr.62.2023.04.21.23.59.32 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 21 Apr 2023 23:59:33 -0700 (PDT) Content-Language: en-US In-Reply-To: <83pm7w30pg.fsf@gnu.org> Received-SPF: pass client-ip=2607:f8b0:4864:20::42e; envelope-from=jporterbugs@gmail.com; helo=mail-pf1-x42e.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:305573 Archived-At: On 4/21/2023 11:11 PM, Eli Zaretskii wrote: >> Date: Fri, 21 Apr 2023 10:44:10 -0700 >> From: Jim Porter >> Cc: emacs-devel@gnu.org, eliz@gnu.org >> >> Eli, what do you think? I've run this against the 5000 latest commits >> and the results look right (though I haven't looked as thoroughly as >> last time). > > I think the hooks should follow the GNU Standards (which are also our > conventions), not their particular expressions in algorithms used by > authors.el. I *think* in this case, the two are the same... or at least the relevant algorithms in authors.el are consistent with the GNU standards. I don't see a strict set of rules in the GNU standards, so I had to make some guesses based on the examples and the implementation in authors.el. This is what I used: 1. A file entry is introduced by a line starting with "*" or ";[ \t]+*" (this is slightly different from authors.el; indenting the "*" will make it not count as a file entry for the purposes of the hooks) 2. A file entry must also contain a ":" before the next blank line 3. A file entry's list of files starts after the leading "*" and continues up until the first ":", "(", "[", or "<" 4. Each file in a list of files is split by spaces, and possibly a comma (specifically ",?[ \t]+")[1] 5. You can continue long file names over multiple lines if necessary I think the first 3 are all consistent with the spirit of the GNU standards as well as all the provided examples. The 4th rule is more questionable; maybe we should be stricter about this one, but I saw that style a dozen or so times in looking through the commit history, and authors.el is ok with it. The last rule only comes up rarely, but it's useful for deeply-nested files (mostly test resources). [1] Note: I tweaked this since the patch I posted. That's the only change though.