unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Karl Fogel <kfogel@red-bean.com>
To: Stefan Kangas <stefan@marxist.se>
Cc: Eli Zaretskii <eliz@gnu.org>,
	emacs-devel@gnu.org, Stefan Monnier <monnier@iro.umontreal.ca>,
	Thien-Thi Nguyen <ttn@gnuvola.org>
Subject: Re: File names in ChangeLog entries
Date: Thu, 02 Dec 2021 00:43:35 -0600	[thread overview]
Message-ID: <87wnknpkvc.fsf@red-bean.com> (raw)
In-Reply-To: <CADwFkm=OYoFuWZRByMheZw+UmwDGFfHNo+rG74QsiO6JrLePuQ@mail.gmail.com> (Stefan Kangas's message of "Wed, 1 Dec 2021 15:14:05 -0800")

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

On 01 Dec 2021, Stefan Kangas wrote:
>Stefan Monnier <monnier@iro.umontreal.ca> writes:
>
>> As for the " (func)" I only put it there if there's room.
>
>In cases where mentioning the function is particularly important, 
>I'd
>rather say
>
>    function-name: Short description
>
>Given that we prefer to include package prefixes in our symbols, 
>it
>should also tell you something about where the function can be 
>found.
>In many cases, at least.
>
>But as you say, it is hard to find hard rules, and some 
>creativity will
>inevitably be needed.

The main point, though, is the one you yourself made earlier:

There is a good reason to keep that first summary line as short as 
possible.  Git often prints it prefixed by other information, in 
such a way that the summary line gets crammed against the right 
edge -- so if it's too long, it may wrap awkwardly or go off the 
screen.

You gave "git log --format=short" as an example, but an even more 
common situation in my experience is "git show-branch".  I'll 
attach some output from that command to this email (as an actual 
text/plain attachment, to make absolutely sure the formatting is 
preserved, since the formatting is important here).  If one looks 
at that output, one can see right away why having reliably short 
summary first-lines in the commit messages is useful.

Many free software projects have adopted a "50 characters, with no 
trailing dot" rule for that first line, to the point where 
programmers often treat it as a standard.  (When we onboard new 
programmers at our company, for example, I find that they 
generally already know about this rule and expect us to be 
following it, which we are.)  Emacs doesn't have to do things the 
way those other projects do, but I hope the above helps clarify 
why we might want to be more consistent about doing it that way.

Our CONTRIBUTE file does already say that 50 chars for the summary 
line is "nicer".  (Although it gives that advice two points down 
from where we first mention the summary line, which is odd.  I've 
attached a patch here that tries to improve this, and would 
appreciate others' review.)

Best regards,
-Karl


[-- Attachment #2: 'git show-branch' sample output --]
[-- Type: text/plain, Size: 987 bytes --]

$ git show-branch master emacs-28
* [master] * lisp/cedet/semantic/bovine/c.el (semantic-tag-protection): Silence warning
 ! [emacs-28] ; Update loaddefs files.
--
*  [master] * lisp/cedet/semantic/bovine/c.el (semantic-tag-protection): Silence warning
*  [master^] * lisp/emacs-lisp/macroexp.el: Improve last change
*  [master~2] Add some primitive momentum-based precision scrolling
*  [master~3] Add `touch-end' event type
*  [master~37] Add an ldefs-boot.el target to the Makefile
...
*  [master~1208] Save position in mark ring before jumping to definition
*  [master~1209] Update emacs-module sources for Emacs 29
*  [master~1210] Bump Emacs version to 29.0.50
 + [emacs-28] ; Update loaddefs files.
 + [emacs-28^] ; make change-history-commit
 + [emacs-28~2] * lisp/repeat.el: Use same logic for repeat-check-key and repeat-exit-timeout.
...
 + [emacs-28~11] CC Mode: Recognise "struct foo {" as introducing a type declaration
*+ [emacs-28~12] ; Auto-commit of loaddefs files.
$ 

[-- Attachment #3: PATCH: Improve CONTRIBUTE's documentation of commit messages --]
[-- Type: text/plain, Size: 2038 bytes --]

diff --git CONTRIBUTE CONTRIBUTE
index 5740004637..7c3421ed75 100644
--- CONTRIBUTE
+++ CONTRIBUTE
@@ -185,20 +185,26 @@ ChangeLog file, where they can be corrected.  It saves time to get
 them right the first time, so here are guidelines for formatting them:
 
 - Start with a single unindented summary line explaining the change;
-  do not end this line with a period.  If that line starts with a
-  semicolon and a space "; ", the commit message will be ignored when
-  generating the ChangeLog file.  Use this for minor commits that do
-  not need separate ChangeLog entries, such as changes in etc/NEWS.
+  do not end this line with a period.  If possible, try to keep the
+  summary line to 50 characters or fewer; this is for compatibility
+  with certain Git commands that print that line in width-constrained
+  contexts.
 
-- After the summary line, there should be an empty line, then
-  unindented ChangeLog entries.
+  If the summary line starts with a semicolon and a space "; ", the
+  commit message will be ignored when generating the ChangeLog file.
+  Use this for minor commits that do not need separate ChangeLog
+  entries, such as changes in etc/NEWS.
+
+- After the summary line, there should be an empty line.
+
+- Unindented ChangeLog entries normally come next.  However, if the
+  commit couldn't be properly summarized in the brief summary line,
+  you can put a paragraph (after the empty line and before the
+  individual ChangeLog entries) that further describes the commit.
 
 - Limit lines in commit messages to 78 characters, unless they consist
   of a single word of at most 140 characters; this is enforced by a
-  commit hook.  It's nicer to limit the summary line to 50 characters;
-  this isn't enforced.  If the change can't be summarized so briefly,
-  add a paragraph after the empty line and before the individual file
-  descriptions.
+  commit hook.
 
 - If only a single file is changed, the summary line can be the normal
   file first line (starting with the asterisk).  Then there is no

  reply	other threads:[~2021-12-02  6:43 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-30 19:19 File names in ChangeLog entries Stefan Kangas
2021-11-30 20:07 ` Philip Kaludercic
2021-11-30 22:01 ` Philipp Stephani
2021-11-30 23:24   ` Stefan Kangas
2021-12-01  3:24     ` Eli Zaretskii
2021-11-30 23:56   ` Andreas Schwab
2021-12-01  3:26     ` Eli Zaretskii
2021-11-30 23:16 ` Stefan Monnier
2021-11-30 23:55   ` Stefan Kangas
2021-12-01  3:32     ` Eli Zaretskii
2021-12-01  3:29   ` Eli Zaretskii
2021-12-01 13:39     ` Stefan Monnier
2021-12-01 13:52       ` Eli Zaretskii
2021-12-01 16:51         ` Stefan Monnier
2021-12-01 17:02           ` Eli Zaretskii
2021-12-01 17:28             ` Karl Fogel
2021-12-01 18:46             ` Stefan Monnier
2021-12-01 19:12               ` Eli Zaretskii
2021-12-01 19:22               ` Thien-Thi Nguyen
2021-12-01 19:32                 ` Eli Zaretskii
2021-12-01 20:49                   ` Thien-Thi Nguyen
2021-12-02  6:37                     ` Eli Zaretskii
2021-12-01 21:03                   ` Stefan Monnier
2021-12-01 21:50                     ` Stefan Kangas
2021-12-01 22:21                       ` Stefan Monnier
2021-12-01 23:14                         ` Stefan Kangas
2021-12-02  6:43                           ` Karl Fogel [this message]
2021-12-02  7:10                             ` Stefan Monnier
2021-12-02  9:12                             ` Juri Linkov
2021-12-02 10:08                               ` Eli Zaretskii
2021-12-02 21:09                                 ` Stefan Monnier
2021-12-03  7:36                                   ` Eli Zaretskii
2021-12-03 12:57                                     ` Stefan Monnier
2021-12-03 13:06                                       ` Eli Zaretskii
2021-12-02 22:11                                 ` Karl Fogel
2021-12-02 11:02                             ` Stefan Kangas
2021-12-03  2:43                               ` Karl Fogel
2021-12-02  7:12                         ` Eli Zaretskii
2021-12-02  7:34                           ` Stefan Monnier
2021-12-02  8:33                             ` Eli Zaretskii
2021-12-02  6:40                       ` Eli Zaretskii
2021-12-02 16:59                     ` Matt Armstrong
2021-12-01  6:11 ` Alfred M. Szmidt

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=87wnknpkvc.fsf@red-bean.com \
    --to=kfogel@red-bean.com \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    --cc=stefan@marxist.se \
    --cc=ttn@gnuvola.org \
    /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).