Subject: bug#72341: VC: CVS template lines not stripped when committing

From: Christoph Badura <[email-masked]>
Date: Sun, 28 Jul 2024 21:48:30 +0200

Resending the message, because debbugs.gnu.org wasn't cc'ed on the
original reply.

On Sun, Jul 28, 2024 at 08:49:15PM +0300, Eli Zaretskii wrote:
> I'm confused by your description.  At the beginning you say:
> 
>   CVS strips all lines beginning with "CVS: " after editing the commit
>   message.
> 
> But later you say:
> 
>   However, the lines starting with "CVS: " aren't stripped out when
>   log-edit-done is called.  The change is then committed with
>   "cvs ci -m" which does not strip these line, as the template file is
>   only loaded when cvs invokes an editor to edit the commit message.

CVS only adds the template file and later strips the "CVS: " lines if
you actually edit the commit message in an editor (which is invoked by
cvs).  I.e. if you do not pass a commit message via "cvs ci -m'message'"
or "cvs ci -F messagefile".

> If "cvs ci -m" doesn't strip the "CVS: " lines, then when and how does
> the stripping you describe at the beginning happens?  And what does
> the last part of the last sentence above, about the template file
> being loaded when CVS invokes an editor, has to do with this issue?

When invoked as "cvs ci -m" (or "cvs ci -F") cvs uses the commit message
*as is*.  With either option, cvs itself doesn't add the template file to
the commit message and hence doesn't have to do any stripping.

log-edit-insert-cvs-template adds the CVS template file to the commit
message outside of cvs.  Therefore log-edit has to strip the "CVS: " lines
outside of cvs too.

Is that clearer?

--chris

--chris