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: Mistakes in commit log messages Date: Tue, 11 Apr 2023 11:31:55 -0700 Message-ID: <319d616d-9230-0a82-331f-0f57488e4c80@gmail.com> References: <835ya5m4p0.fsf@gnu.org> <83v8i4arzt.fsf@gnu.org> <838rezardu.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="30857"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Alan Mackenzie , Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Apr 11 20:32:32 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 1pmInA-0007uQ-3s for ged-emacs-devel@m.gmane-mx.org; Tue, 11 Apr 2023 20:32:32 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pmImj-0005qW-Hi; Tue, 11 Apr 2023 14:32:05 -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 1pmIme-0005pC-2c for emacs-devel@gnu.org; Tue, 11 Apr 2023 14:32:00 -0400 Original-Received: from mail-pj1-x1034.google.com ([2607:f8b0:4864:20::1034]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pmImc-00079B-FB; Tue, 11 Apr 2023 14:31:59 -0400 Original-Received: by mail-pj1-x1034.google.com with SMTP id d22-20020a17090a111600b0023d1b009f52so11861034pja.2; Tue, 11 Apr 2023 11:31:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1681237916; x=1683829916; h=content-transfer-encoding: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=5DTknyliiTJOp7VVIVBGXrLOXGeNGwJwx14jugDMpV4=; b=C9xY4zf2sce1cn/UvNbotbHtS93MXpBOPQmz4yAUyDKQgb1j1cO/Ey+im+XiQUO8ee oTlehLAF86mCxjK/DrWOEitqFcE2+4YCQWAgn6dJaA1jDZh9L450wn+OITPf55uZWKV7 ThGyqRz5ektYPKbbDkvSQ8It6b3cTieEHdin8tOS3RQKbmvd6px/5QV5zVvd3K/w5aSA dtHb8qJyKGkMs3zWkhrLHfehts0E7CerO0UG875sjHZSW1JEEIGkBOSptw26yGyRM+a6 6a2XBIOAUzCZHwuBQwrWz3rv7eAHd4jGAhVoqlTUEl2ch1fKeraO29baFz8rG2jSFzs3 mJ9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1681237916; x=1683829916; h=content-transfer-encoding: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=5DTknyliiTJOp7VVIVBGXrLOXGeNGwJwx14jugDMpV4=; b=PqbqR9vUv4T4NtUjKviIxBwhFjH9FizSGrth3wpbSVfe0vXrUPzRNakwAvtZ/Hz0Pq XXUpQk9yurnBpsxbprYxcamtKHAgBiXvW3vS7EEb6nSkH05VuwaBd8UsPTnsGLIMzmrE aiY/duKxLZ5JfYk1/yORLgZakN5QUKIJ9n9PcI9BWeEHUeAW6EF7v/R6H8uHU1ZlFNGu ouyRJh1Yb+JaYCPEWBY0yan1cXt/zlwOaGHg3SIKy48yO/SP0onnZ08/9OW0i9kbPKxa VhsKob8Ve6ZsoaHzC+q5dxCFnHqqQLnSP3GUXu7qaK2Hz1GWBwPYvyCPDs77aJHW1T4U UWTQ== X-Gm-Message-State: AAQBX9cpqwHeKNe/qXJZicw88YaWRuN2NGWp9rfpXwmF8uGue5tn0OAD Gvdlu7oSzfO6ybxdNW2dCnP2NDlC1tUk9g== X-Google-Smtp-Source: AKy350bQlXCrk5RlwO+6p9sv3CXySU0qdNaforIM1g+XLYquLUIKnpIkHaSVVQSsVImvO4XxK5I9HQ== X-Received: by 2002:a17:90b:3ec4:b0:240:3ee4:d2d1 with SMTP id rm4-20020a17090b3ec400b002403ee4d2d1mr5172581pjb.13.1681237916106; Tue, 11 Apr 2023 11:31:56 -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 w12-20020a170902a70c00b0019abb539cddsm10013592plq.10.2023.04.11.11.31.55 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 11 Apr 2023 11:31:55 -0700 (PDT) Content-Language: en-US In-Reply-To: Received-SPF: pass client-ip=2607:f8b0:4864:20::1034; envelope-from=jporterbugs@gmail.com; helo=mail-pj1-x1034.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 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:305245 Archived-At: On 4/11/2023 7:01 AM, Alan Mackenzie wrote: > > + /^\* [a-zA-Z0-9_.~#-]/ { > + nfiles++ > + if ((rc = (getline x < $2)) < 0) { > + status = 1 > + print "File " $2 " cannot be read: [" ERRNO "]" > + } > + close($2) > + } One thing to be careful of here (which is why I did the 'match'/'substr' dance in my patch) is that we need to be able to handle lines like this correctly: * some/file.el: New file. Normally, awk would split that so that $2 is "some/file.el:", which isn't right. Maybe there's a better method than my patch though. I'm definitely not an awk expert (this is the first awk code I've ever written). Also, using 'getline' will work for checking files, but not directories. I'm not sure this ever comes up in practice, but it might occur once in a while if we import a large package into the Emacs tree. We could do a bit of feature-checking and upgrade to using 'stat' if we have a newish gawk. That way, gawk users would get proper checks for this (rare) case. (This might not be strictly necessary.) Finally, I think it would make sense to have this be a purely advisory warning for now so that we could check it into the Emacs tree soon-ish. As Eli suggests, we can try running with this hook locally, but since I've already added some Lisp code to generate the changelog for my workflow, I'm probably never going to trigger this myself. If this check is just a warning, I think we could be a little more aggressive in merging this, since it shouldn't break anyone's workflows.