From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?utf-8?Q?Arsen_Arsenovi=C4=87?= Newsgroups: gmane.emacs.devel Subject: Re: Adding git-commit highlight mode? Date: Thu, 02 Jan 2025 23:27:13 +0100 Message-ID: <87ldvsx35q.fsf@aarsen.me> References: <37733be4476e1c2b6e873c967c79cb0035959a9e.camel@yandex.ru> <86wmfdhwg7.fsf@gnu.org> <0347118b217c57e4e62018547883fad5f1d1e63e.camel@yandex.ru> <86r05lht77.fsf@gnu.org> <875xmwykuk.fsf@aarsen.me> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="37982"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Eli Zaretskii , Konstantin Kharlamov , emacs-devel@gnu.org To: Stefan Kangas Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Jan 02 23:28:16 2025 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 1tTTfs-0009kQ-3K for ged-emacs-devel@m.gmane-mx.org; Thu, 02 Jan 2025 23:28:16 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tTTf4-00034z-W4; Thu, 02 Jan 2025 17:27:27 -0500 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 1tTTf3-00034l-Hp for emacs-devel@gnu.org; Thu, 02 Jan 2025 17:27:25 -0500 Original-Received: from mout-p-102.mailbox.org ([80.241.56.152]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_CHACHA20_POLY1305:256) (Exim 4.90_1) (envelope-from ) id 1tTTf1-0001Ce-Jk; Thu, 02 Jan 2025 17:27:25 -0500 Original-Received: from smtp102.mailbox.org (smtp102.mailbox.org [10.196.197.102]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-102.mailbox.org (Postfix) with ESMTPS id 4YPLtD2fWMz9slY; Thu, 2 Jan 2025 23:27:16 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aarsen.me; s=MBO0001; t=1735856836; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=zqmCRFAeyvdnrZR8cb/MtAeuxuK7Lq1tK5MmVocs4QA=; b=HF7xKjebiPD6A9j4/o0igJoSVJR1Vm1W61nTz/IlDcMA3fiMPin9vTivTFJlmER9N7Ic50 1O7yGF/WsXO4/LniP6lNN3t9t+ORjuuuNyVssduKhWhaJiV1YGp/iGO2acPFPS/MSslqC6 wR94RmLFahsUpBAgwRJwwwGg7YK9ss/vv9dxvPwt03bXnYEArtiDxJLxGJkqARZhyaPLac R8EdVwp4sRhYyCkVXyCiU39bFJ7wWbcvOlFQ4dCVcqB4Lg91YN6iIKhNWZVRw6riVS2O2W WZ8IsqAL3jOJ2q/xxjJINHzkFixWN6R6uaaD7U4Tiqaaco1ZL2V056pMhaIzlQ== In-Reply-To: (Stefan Kangas's message of "Thu, 2 Jan 2025 15:53:29 -0600") Received-SPF: pass client-ip=80.241.56.152; envelope-from=arsen@aarsen.me; helo=mout-p-102.mailbox.org X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, 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:327603 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Stefan Kangas writes: > Arsen Arsenovi=C4=87 writes: > >> A thing that a git commit mode ought to do, however, is set fill-column >> to 72, highlight any content on line 2 as erroneous, and limit the first >> line to 50 characters. This is conventional in Git: >> https://git-scm.com/docs/git-commit#_discussion >> https://git-scm.com/book/en/v2/Distributed-Git-Contributing-to-a-Project= .html#_commit_guidelines > > I agree with the 72 character fill-column, and have in the past > suggested using that for ChangeLog's also. (There was recently a > decision to reduce the fill-column even further instead.) > > AFAICT, the 50 character line limit for the summary line is not really > followed very strictly in practice by most projects, including the Linux > kernel. It's more of a recommendation. Even the link you provide above > says that it's "a good idea" to use "no more than 50 characters" for it. > For that reason, I think that this should be a warning (with a highlight > if you go over), and not a hard limit. Right, I didn't mean hard limit. I think Vim implements this well - it stops coloring after column 50. This isn't overly aggressive but is still effective and handy. > In `git-commit-mode`, the user option `git-commit-summary-max-length' is > 68 by default, which strikes me as unopinionated enough. > >> As far as I know, some of these guidelines conflict with changelog >> guidelines. > > They are not fundamentally incompatible, AFAIU. I've been making them fit together, so I'm certain it is not fundamental :-) On that note, another interesting datapoint within GNU is GCC, which has a particular commit message format. Here's a random example from GCC: commit 4ee692337c4ec18fe9be3df34f3607ea3de5ef93 Author: Jason Merrill c++: -fimplicit-constexpr diagnostic improvement [PR116696] =20=20=20=20 PR116696 expressed surprise that explicit 'constexpr' was needed on one function; this was because the function isn't 'inline', and -fimplicit-constexpr doesn't try to promote non-inline functions. Let'= s be more helpful in that situation, and also help trace through functions t= hat were promoted. =20=20=20=20 PR c++/116696 =20=20=20=20 gcc/cp/ChangeLog: =20=20=20=20 * constexpr.cc (explain_invalid_constexpr_fn): When -fimplicit-constexpr, also explain inline functions, and point = out non-inline functions. =20=20=20=20 gcc/testsuite/ChangeLog: =20=20=20=20 * g++.dg/DRs/dr2478.C: Prune extra diagnostic. * g++.dg/ext/fimplicit-constexpr1.C: New test. Notice the ChangeLog segments towards the end, I'd appreciate if Emacs handled these well. Have a lovely year! =2D-=20 Arsen Arsenovi=C4=87 --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iIYEARYKAC4WIQT+4rPRE/wAoxYtYGFSwpQwHqLEkwUCZ3cSwRAcYXJzZW5AYWFy c2VuLm1lAAoJEFLClDAeosST5wEA+wRHXuN+fpXIr7j+tkAaxVV4+Orzh4u6W0y5 OLZmJQ1FAP0WHqSMHIl7AgaIMY/FwMb2uicy6JJvjuSqSz4xlZmJAQ== =ofQB -----END PGP SIGNATURE----- --=-=-=--