From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Mistakes in commit log messages Date: Tue, 11 Apr 2023 17:57:35 +0300 Message-ID: <83edoqa2lc.fsf@gnu.org> References: <835ya5m4p0.fsf@gnu.org> <83v8i4arzt.fsf@gnu.org> <838rezardu.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="31354"; mail-complaints-to="usenet@ciao.gmane.io" Cc: jporterbugs@gmail.com, emacs-devel@gnu.org To: Alan Mackenzie Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Apr 11 16:57:50 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 1pmFRN-0007u8-Cu for ged-emacs-devel@m.gmane-mx.org; Tue, 11 Apr 2023 16:57:49 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pmFQW-0000d9-7v; Tue, 11 Apr 2023 10:56:56 -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 1pmFQU-0000d1-3Z for emacs-devel@gnu.org; Tue, 11 Apr 2023 10:56:54 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pmFQT-0000bM-9J; Tue, 11 Apr 2023 10:56:53 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=jWA43XwLnEublw+fp9gX9xldFK3uFZAjzIxJebnPxYs=; b=IOxRAq9bsBYJ VMQjnK+hIC10fikahvhMfHHy0G+8J3AupSj1dX61Y3vgNsu8NFp1yyYymtw/cb2Mw7mFEoELPLxlQ +fgfAexKqHr3skSgvij6sO7bmI7zgsa5SHMc9F29pgJHehKCCmYmdRMwPgSL/CLHIzkp9GRE31h/s C0iPXBrKCrmFHrwvuvVqc9VNPOIbX1EUM4wqlif99jSb6ENrSY8hwji3wkCdyC6yJJigaGQOJteHk JPKrfQpz6F4mGS2wYrpNZCQwGRYV5pSpO1PqKbnWEePLl2bCyu30HtI+ycScsSY6hPVlJwcPv35s9 2lZ1NUCzZqHrvK4IbBl4xQ==; Original-Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pmFQS-0005Y9-N1; Tue, 11 Apr 2023 10:56:52 -0400 In-Reply-To: (message from Alan Mackenzie on Tue, 11 Apr 2023 14:01:48 +0000) 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:305239 Archived-At: > Date: Tue, 11 Apr 2023 14:01:48 +0000 > Cc: Jim Porter , emacs-devel@gnu.org > From: Alan Mackenzie > > + /^\* [a-zA-Z0-9_.~#-]/ { > + nfiles++ > + if ((rc = (getline x < $2)) < 0) { > + status = 1 > + print "File " $2 " cannot be read: [" ERRNO "]" The error message should explicitly mention an error in the file name or its leading directories, at least if ERRNO indicates the file does not exist. "File FOO cannot be read is too "technical" and doesn't explain what we are checking. Also, I'm not sure what is CWD when this script runs. Suppose I invoke "git commit" from a subdirectory of the tree root -- does this find files in that case? > + if (!nfiles) { > + print "No file lines in commit message" > + status = 1 This was never an error before, so shouldn't be an error now. Log messages saying just Fix last change are quite common, and I don't want to disallow them. In any case, I suggest that you (and maybe others) try running with this for some time, to make sure there are no regressions. Thanks. P.S. Is 'getline' available in non-GNU Awk's?