From: Eli Zaretskii <eliz@gnu.org>
To: Christoph Badura <bad@bsd.de>, Dmitry Gutov <dmitry@gutov.dev>
Cc: 72341@debbugs.gnu.org
Subject: bug#72341: VC: CVS template lines not stripped when committing
Date: Mon, 29 Jul 2024 15:34:32 +0300 [thread overview]
Message-ID: <86a5i0z89z.fsf@gnu.org> (raw)
In-Reply-To: <20240729095312.GZ9440@irregular-apocalypse.k.bsd.de> (message from Christoph Badura on Mon, 29 Jul 2024 11:53:13 +0200)
> Date: Mon, 29 Jul 2024 11:53:13 +0200
> From: Christoph Badura <bad@bsd.de>
> Cc: 72341@debbugs.gnu.org
>
> On Mon, Jul 29, 2024 at 05:26:50AM +0300, Eli Zaretskii wrote:
> > Somewhat clearer, thanks. I don't see this stripping feature
> > documented in the CVS manual; did I miss something?
>
> I didn't see it documented either. The closest thing that comes to
> documentation of that feature is the documentation for rcsinfo:
> https://www.gnu.org/software/trans-coord/manual/cvs/html_node/rcsinfo.html#rcsinfo
This says nothing about the "CVS: " prefix, AFAICT.
> It is implemented in src/logmsg.c:do_editor().
>
> > And one more questions: where do those "CVS:" lines come from when you
> > use the template file?
>
> They have to be be in the template file.
>
> I figure the idea is that the template files can contain "mandatory" text
> that will be part of the actuall log message and "explanatory" text,
> prefixed with "CVS: ", that will be stripped after the commit message has
> been edited.
>
> As an example, here's the default template for the NetBSD repositories:
> ----------------8<------------------8<------------------8<-----------------
> CVS: ----------------------------------------------------------------------
> CVS: CVSROOT cvs.NetBSD.org:/cvsroot
> CVS: please use "PR category/123" to have the commitmsg appended to PR 123
> ----------------8<------------------8<------------------8<-----------------
>
> I'm only aware of the NetBSD and pkgsrc repositories that make use of CVS
> templates. And their template files contain only lines prefixed with
> "CVS: ".
I think I see what's happening. This is basically an undocumented
feature. The removal of "CVS: " lines is there for when CVS itself
invokes the editor: in that case, it injects instructions into the
temporary file that it submits to the editor, and those instructions
all start with "CVS: ", so that they could be later removed. IOW,
this prefix is basically an agreement between CVS and itself.
Now, nothing in the documentation of CVS/Template file says anything
about "CVS: ", but the code processes the temporary file, which
includes the template, the same as it processes the lines injected by
CVS, and thus every line that begins with "CVS: " in the template will
be removed.
IOW, NetBSD piggy-backs this feature to include their own instructions
in the template.
I'm unsure how to proceed with this. My bother is that this is a
definite change in behavior wrt what VC did until now. Users of VC
might be unaware of this removal, and could start some log lines with
the prefix, which will mysteriously disappear from the log message.
Dmitry, WDYT? Maybe we should add this removal guarded by a user
option, by default off? Or maybe we can identify where the template
starts and ends, and only remove in that region?
> Off topic and speaking of documentation.
> I noticed that
> https://www.gnu.org/software/emacs/manual/html_node/emacs/Log-Buffer.html
> doesn't document C-c C-k and doesn't explain how the region is set up so
> that an initial C-w will kill from point to the end of the buffer. log-edit's
> documentation is also not correct with regard to this (i.e. the entire log
> buffer isn't emptied as point is after the Summary: header).
>
> Is that worth reporting separately?
Yes, probably. IMO, documenting "C-c C-k" should be accompanied with
the description of log-edit-comment-ring and its usage, otherwise the
command will not make sense to the users.
next prev parent reply other threads:[~2024-07-29 12:34 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-28 12:32 bug#72341: VC: CVS template lines not stripped when committing Christoph Badura
2024-07-28 17:49 ` Eli Zaretskii
2024-07-28 19:48 ` Christoph Badura
[not found] ` <20240728192115.GY9440@irregular-apocalypse.k.bsd.de>
2024-07-29 2:26 ` Eli Zaretskii
2024-07-29 9:53 ` Christoph Badura
2024-07-29 12:34 ` Eli Zaretskii [this message]
2024-07-29 15:02 ` Christoph Badura
2024-07-30 13:35 ` Dmitry Gutov
2024-08-02 7:19 ` Eli Zaretskii
2024-08-09 15:11 ` Christoph Badura
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=86a5i0z89z.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=72341@debbugs.gnu.org \
--cc=bad@bsd.de \
--cc=dmitry@gutov.dev \
/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).