From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.bugs Subject: bug#36208: 26.2.50; Add tooling for commit message format checking Date: 17 Jun 2019 07:39:32 -0000 Organization: muc.de e.V. Message-ID: <20190617073932.62027.qmail@mail.muc.de> References: <87ftocyuzi.fsf@cassou.me> Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="220688"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: tin/2.4.2-20171224 ("Lochhead") (UNIX) (FreeBSD/11.2-RELEASE-p9 (amd64)) Cc: 36208@debbugs.gnu.org To: Damien Cassou Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Jun 17 09:40:12 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hcmFN-000vFS-Ok for geb-bug-gnu-emacs@m.gmane.org; Mon, 17 Jun 2019 09:40:09 +0200 Original-Received: from localhost ([::1]:44750 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hcmFM-0006KV-KO for geb-bug-gnu-emacs@m.gmane.org; Mon, 17 Jun 2019 03:40:08 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:60973) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hcmFH-0006KP-F0 for bug-gnu-emacs@gnu.org; Mon, 17 Jun 2019 03:40:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hcmFG-0005Bf-8n for bug-gnu-emacs@gnu.org; Mon, 17 Jun 2019 03:40:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:56532) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hcmFG-0005BS-5e for bug-gnu-emacs@gnu.org; Mon, 17 Jun 2019 03:40:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hcmFG-00013v-06 for bug-gnu-emacs@gnu.org; Mon, 17 Jun 2019 03:40:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 17 Jun 2019 07:40:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 36208 X-GNU-PR-Package: emacs Original-Received: via spool by 36208-submit@debbugs.gnu.org id=B36208.15607571824050 (code B ref 36208); Mon, 17 Jun 2019 07:40:01 +0000 Original-Received: (at 36208) by debbugs.gnu.org; 17 Jun 2019 07:39:42 +0000 Original-Received: from localhost ([127.0.0.1]:41843 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hcmEv-00013F-NT for submit@debbugs.gnu.org; Mon, 17 Jun 2019 03:39:41 -0400 Original-Received: from colin.muc.de ([193.149.48.1]:60051 helo=mail.muc.de) by debbugs.gnu.org with smtp (Exim 4.84_2) (envelope-from ) id 1hcmEs-000133-VT for 36208@debbugs.gnu.org; Mon, 17 Jun 2019 03:39:39 -0400 Original-Received: (qmail 62028 invoked by uid 3782); 17 Jun 2019 07:39:32 -0000 In-Reply-To: X-Newsgroups: gnu.emacs.bug X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:160710 Archived-At: Hello, Damien. In article you wrote: > Hi > writing commit messages that comply with Emacs' guidelines requires a > good understanding of many details described in CONTRIBUTE. To reduce > the workload of new contributors and of reviewers, part of these > guidelines could be transformed into tools. It's worth pointing out that C-x 4 a (add-change-log-entry-other-window), from the days when we used to write ChangeLog entries, does some of what you're asking for. Maybe this could be adapted. > Here are some of the checks that humans have to do these days: > 1. dots after every sentence (even just "New function" must terminate > with a dot) > 2. double-space after dots ending sentences > 3. no indentation (M-q adds 2 spaces which we don't want) > 4. line length > 5. the Copyright-paperwork-exempt token > 6. every single change is documented > 7. no colon if another function of the same file has the same comment What we are really missing is an ability to edit commit messages after committing with a faulty message. This is a deficiency of git. > I can imagine several tools: > - a major mode for editing commit messages: > - for check 2., sentence-end-double-space could be set to t > - for check 3., I guess another variable could be set > - for check 4., setting fill-column > - for check 5., a shortcut could help adding such tokens > - for check 6., a shortcut (beyond `C' which triggers > `magit-commit-add-log-insert') could add a template with all the > changes > - a flymake backend to mark problems: > - for checks 1., 3., 4., and 7., I believe it's obvious > - for check 2., words ending with a dot and just one space (with a > whitelist to avoid false positives such as "etc." and "aka.") > - a patch checker (e.g., `./check_patch.sh *.patch`): > - could check the same as the flymake backend and also checks 5 and 6. > Best, > -- > Damien Cassou > http://damiencassou.seasidehosting.st > "Success is the ability to go from one failure to another without > losing enthusiasm." --Winston Churchill -- Alan Mackenzie (Nuremberg, Germany).