unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Arsen Arsenović" <arsen@aarsen.me>
To: Stefan Kangas <stefankangas@gmail.com>
Cc: Eli Zaretskii <eliz@gnu.org>,
	 Konstantin Kharlamov <Hi-Angel@yandex.ru>,
	 emacs-devel@gnu.org
Subject: Re: Adding git-commit highlight mode?
Date: Thu, 02 Jan 2025 23:27:13 +0100	[thread overview]
Message-ID: <87ldvsx35q.fsf@aarsen.me> (raw)
In-Reply-To: <CADwFkmnOYR-cJ2z+axvsfCmL-Xtj4=5+2Pzux-LT__xXjNm-GA@mail.gmail.com> (Stefan Kangas's message of "Thu, 2 Jan 2025 15:53:29 -0600")

[-- Attachment #1: Type: text/plain, Size: 2790 bytes --]

Stefan Kangas <stefankangas@gmail.com> writes:

> Arsen Arsenović <arsen@aarsen.me> 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]
    
    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 that
    were promoted.
    
            PR c++/116696
    
    gcc/cp/ChangeLog:
    
            * constexpr.cc (explain_invalid_constexpr_fn): When
            -fimplicit-constexpr, also explain inline functions, and point out
            non-inline functions.
    
    gcc/testsuite/ChangeLog:
    
            * 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!
-- 
Arsen Arsenović

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 251 bytes --]

  reply	other threads:[~2025-01-02 22:27 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-02 18:30 Adding git-commit highlight mode? Konstantin Kharlamov
2025-01-02 19:01 ` Eli Zaretskii
2025-01-02 19:07   ` Konstantin Kharlamov
2025-01-02 20:10     ` Stefan Kangas
2025-01-02 21:01       ` Eli Zaretskii
2025-01-02 21:38         ` Stefan Kangas
2025-01-03  5:26           ` Jim Porter
2025-01-02 21:40       ` Konstantin Kharlamov
2025-01-03  5:29         ` Jim Porter
2025-01-03 13:08       ` Jonas Bernoulli
2025-01-02 20:11     ` Eli Zaretskii
2025-01-02 21:19       ` Arsen Arsenović
2025-01-02 21:53         ` Stefan Kangas
2025-01-02 22:27           ` Arsen Arsenović [this message]
2025-01-03 21:02           ` Sean Whitton
2025-01-04  7:17             ` Eli Zaretskii
2025-01-04  9:52               ` Sean Whitton
2025-01-03  6:45         ` Eli Zaretskii
2025-01-02 19:17 ` Jim Porter
2025-01-02 19:19   ` Konstantin Kharlamov
2025-01-02 20:17   ` Eli Zaretskii
2025-01-03 21:14   ` Björn Bidar
2025-01-05 14:39     ` Philip Kaludercic
2025-01-05 22:48       ` Konstantin Kharlamov
     [not found]   ` <87r05jbnw2.fsf@>
2025-01-03 22:52     ` Konstantin Kharlamov
2025-01-04  1:22       ` Björn Bidar
     [not found]       ` <87v7uv9xub.fsf@>
2025-01-04  1:45         ` Konstantin Kharlamov
2025-01-05  0:46           ` Björn Bidar
     [not found]           ` <871pxiulxz.fsf@>
2025-01-05  3:55             ` Konstantin Kharlamov
2025-01-04 12:50         ` Jonas Bernoulli
2025-01-04 17:20           ` Jonas Bernoulli
2025-01-05  0:32           ` Björn Bidar
2025-01-05 18:47           ` Jim Porter
2025-01-05  0:42 ` Björn Bidar
     [not found] ` <875xmuum48.fsf@>
2025-01-05  3:49   ` Konstantin Kharlamov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87ldvsx35q.fsf@aarsen.me \
    --to=arsen@aarsen.me \
    --cc=Hi-Angel@yandex.ru \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=stefankangas@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).