From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#72341: VC: CVS template lines not stripped when committing Date: Mon, 29 Jul 2024 15:34:32 +0300 Message-ID: <86a5i0z89z.fsf@gnu.org> References: <20240728123256.GW9440@irregular-apocalypse.k.bsd.de> <86plqxz9t0.fsf@gnu.org> <20240728192115.GY9440@irregular-apocalypse.k.bsd.de> <86le1lylud.fsf@gnu.org> <20240729095312.GZ9440@irregular-apocalypse.k.bsd.de> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="18179"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 72341@debbugs.gnu.org To: Christoph Badura , Dmitry Gutov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Jul 29 14:35:36 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1sYPbD-0004Xi-81 for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 29 Jul 2024 14:35:35 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sYPam-0005R4-1f; Mon, 29 Jul 2024 08:35:08 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sYPaW-000540-Nr for bug-gnu-emacs@gnu.org; Mon, 29 Jul 2024 08:34:53 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sYPaU-0001jr-9V for bug-gnu-emacs@gnu.org; Mon, 29 Jul 2024 08:34:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=References:In-Reply-To:From:Date:To:Subject; bh=Z0MqecO10mXB23HV1ExkHBb1yPgEwTFrNRfL21ZyvKU=; b=o02BHZWGfENYDAsjNPvRqlgTwR4xjw39gL3hYcwkjdlpKm3kwGJlc2uA7dVCNNWq2kcL0Am6+EVADJEhpgd/rtwo8oDILJT2Rk8xlSQKKjdkb6a2SYKgjoTqusCb002tDxL4DDUoG+WvQIZWd7aN+IEu4coxFbuweKbnq9JS+rVI3QC5Y3Itm6eTP5IYPD3rPeidW9ManKK7moGwhGihJSrJGAoST16JnZXPXNFOcvbxhH3EwkyxwHqORE9tx+tRsTG99VfvOClyGbcUYGwZADqF65dC8NOHWO61p8HcPnTDP7dWO9IQwHb9RgkhQjsgvz9P3alQx7fixH5TB14c4Q==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sYPag-0002a1-Lp for bug-gnu-emacs@gnu.org; Mon, 29 Jul 2024 08:35:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 29 Jul 2024 12:35:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 72341 X-GNU-PR-Package: emacs Original-Received: via spool by 72341-submit@debbugs.gnu.org id=B72341.17222564979897 (code B ref 72341); Mon, 29 Jul 2024 12:35:02 +0000 Original-Received: (at 72341) by debbugs.gnu.org; 29 Jul 2024 12:34:57 +0000 Original-Received: from localhost ([127.0.0.1]:45092 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sYPaa-0002ZY-M0 for submit@debbugs.gnu.org; Mon, 29 Jul 2024 08:34:57 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:48274) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sYPaY-0002ZJ-LS for 72341@debbugs.gnu.org; Mon, 29 Jul 2024 08:34:55 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sYPaF-0001iY-EV; Mon, 29 Jul 2024 08:34:35 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=Z0MqecO10mXB23HV1ExkHBb1yPgEwTFrNRfL21ZyvKU=; b=ftABTdE5/rHo Bnw0mzeA5C3mz4P2E3r3wov/pq8Djhn7Nzghtf6StZ2p1qB5YIvMow4KmHXROJJlNUEDmXhiUaAqo 63vQLNgsVjXJkoU3RuWZDOsFYCOvCahmxLBUjwXhvpwHFlIRbLbUHIJ3ha1XKlHRz2FV35RufGQIt +9hnHJHA1TzmvBW3o/1XLBRFcRCFMO28B7DcKvinVNesaCp+ZZHjpOO4+SVsqX33PWX46xk2XdXf2 FFoTmWcBAYxL0Zxyb3bY2iw/JrzCLcOc6g4ak+Wk6ipUFE/YbWwFnlvlsb0Gqbd3Wly8830rwseQT kK1BE8s4p0B8nGSveX0scA==; In-Reply-To: <20240729095312.GZ9440@irregular-apocalypse.k.bsd.de> (message from Christoph Badura on Mon, 29 Jul 2024 11:53:13 +0200) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:289519 Archived-At: > Date: Mon, 29 Jul 2024 11:53:13 +0200 > From: Christoph Badura > 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.