unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Jonas Bernoulli via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 75355@debbugs.gnu.org
Subject: bug#75355: [PATCH 1/1] Improve comment cycling in log-edit
Date: Sun, 05 Jan 2025 12:37:38 +0100	[thread overview]
Message-ID: <87cyh17app.fsf@bernoul.li> (raw)
In-Reply-To: <86a5c5afdu.fsf@gnu.org>

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Jonas Bernoulli <jonas@bernoul.li>
>> Cc: 75355@debbugs.gnu.org
>> Date: Sat, 04 Jan 2025 23:29:34 +0100
>> 
>> Eli Zaretskii <eliz@gnu.org> writes:
>> 
>> >> Date: Sat,  4 Jan 2025 18:11:08 +0100
>> >> From:  Jonas Bernoulli via "Bug reports for GNU Emacs,
>> >>  the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
>> >> 
>> >> Save the current message before cycling to older messages, making it
>> >> possible to cycle back to that initial message.
>> >
>> > Thanks, but can you provide some rationale for this?  Is the
>> > assumption that users need to make several commits that all share the
>> > same comment or something?
>> 
>> That is one use-case for the feature as it exists now, yes.  Messages
>> are already automatically saved once the user either finished or aborts
>> the commit.
>> 
>> These changes don't really affect that.  I consider this additional
>> automatic saving a bugfix.  Without it, a user may start typing a new
>> message, decide to use a recent message instead, navigate to it but then
>> change their mind about that, and then they would not be able to go back
>> to the new message they had already started typing, because it was
>> discarded when they moved a way from it.  By saving the new message when
>> we move away from it, we make it possible to navigate back to it.
>
> What do you mean by "move away" and "navigate", in the context of
> log-edit?

The buffer contains a draft to be used as the message for the commit
you are about to create.  "Moving away" from the message means using
the commands log-edit-previous/next-comment to "navigate" to another
message.  Doing so erased the contents of the buffer, and another
recently used message is inserted in its place.

>> By additionally defining log-edit-save-comment as a command we gain the
>> ability to save the message at random point.  This could, for example,
>> be useful if we have to use very similar messages in different commits,
>> potentially across multiple repositories.
>
> Is this a frequent use case?  Why would the same log message be used
> for different commits?

Using the same or very similar commit messages across different
repositories is a very frequent occurrence for me.  The last such
message was "Bump copyright years", but through out the year I also use
messages such as "Fix spelling errors", after running a spell-checker on
all my packages.

Granted, those two examples didn't need a "template".  I also frequently
fix some class of error across many third-party packages, as part of my
work on Melpa and the Emacsmirror.  In such cases I often write a long,
message explaining why something should be done a certain way.  The
message is almost the same for every repository/package but I try to use
the names of the files in each particular repository, to make things more
engaging and actionable for each individual package maintainer.

Note that the command log-edit-save-comment is also used in code twice,
so the cost of making it a command is just the line " (interactive)".
If you feel this command is not useful enough to receive a default key
bindings, we can drop that, but the interactive form should remain.





      reply	other threads:[~2025-01-05 11:37 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-04 16:28 bug#75355: [PATCH 0/1] Improve comment cycling in log-edit Jonas Bernoulli via Bug reports for GNU Emacs, the Swiss army knife of text editors
2025-01-04 17:11 ` bug#75355: [PATCH 1/1] " Jonas Bernoulli via Bug reports for GNU Emacs, the Swiss army knife of text editors
2025-01-04 18:39   ` Eli Zaretskii
2025-01-04 22:29     ` Jonas Bernoulli via Bug reports for GNU Emacs, the Swiss army knife of text editors
2025-01-05  7:28       ` Eli Zaretskii
2025-01-05 11:37         ` Jonas Bernoulli via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]

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=87cyh17app.fsf@bernoul.li \
    --to=bug-gnu-emacs@gnu.org \
    --cc=75355@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=jonas@bernoul.li \
    /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).