From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.bugs Subject: bug#64055: [WIP Patch] Enable editing commit messages - vc-git-modify-change-comment Date: Sun, 20 Oct 2024 01:16:25 +0100 Message-ID: References: <87pm5yo4m7.fsf@gmail.com> <87legmnq4l.fsf@gmail.com> <87r090o8cl.fsf@melete.silentflame.com> <874j5vgypf.fsf@melete.silentflame.com> <787fb692-db24-4682-871b-5a52d31a1249@gutov.dev> <87ed4obs1b.fsf@melete.silentflame.com> <87jze6vwtx.fsf@melete.silentflame.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="28785"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla Thunderbird Cc: Morgan Smith , Robert Pluim , 64055@debbugs.gnu.org To: Sean Whitton Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Oct 20 02:18:00 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 1t2Jdu-0007Kz-W0 for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 20 Oct 2024 02:18:00 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t2Jdc-0000g5-RY; Sat, 19 Oct 2024 20:17:40 -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 1t2JdZ-0000fb-Tc for bug-gnu-emacs@gnu.org; Sat, 19 Oct 2024 20:17:39 -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 1t2JdZ-0006P7-Hw for bug-gnu-emacs@gnu.org; Sat, 19 Oct 2024 20:17:37 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=In-Reply-To:From:References:MIME-Version:Date:To:Subject; bh=3hKUZeHbzWJhr526avBDXrQpmlbm7FY0YHUsL9lYbxA=; b=gbAjKLScz/a9Spw3K6WzYLG7qCiuNKFG4sTYcGR6zcgxrKYd6E3iJ3VlzIkY5L4cSYVB0U2JOrv20BZNqJeXXam7FVSul79s8OiTSHPE5PXXe8CEI0oPd38npBzEjAH/Vzewiok1thCytmgk1kQW0YJxTNw/ba3k3jSfAt0+5uSvRV7buVkaL/tsjZq1xkPu2qQfcaE1Zhi0cYjxlThLUBJezZFxBdZfklW4i3c0FLD6SAJl3rudT+mjzSoa4FomyusMQrCQhAwpwjfVrrTCk2Qa6p4jZhE3GkniiBdhJhSMsCmpRDfnlpLF5tMGtN6S+jNB4+JusmoflpE5dVPziQ==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1t2Jdx-0004gk-Q9 for bug-gnu-emacs@gnu.org; Sat, 19 Oct 2024 20:18:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 20 Oct 2024 00:18:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 64055 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 64055-submit@debbugs.gnu.org id=B64055.172938342217933 (code B ref 64055); Sun, 20 Oct 2024 00:18:01 +0000 Original-Received: (at 64055) by debbugs.gnu.org; 20 Oct 2024 00:17:02 +0000 Original-Received: from localhost ([127.0.0.1]:45155 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t2Jcz-0004f3-VY for submit@debbugs.gnu.org; Sat, 19 Oct 2024 20:17:02 -0400 Original-Received: from fout-a4-smtp.messagingengine.com ([103.168.172.147]:42385) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t2Jcx-0004ef-Be for 64055@debbugs.gnu.org; Sat, 19 Oct 2024 20:17:00 -0400 Original-Received: from phl-compute-01.internal (phl-compute-01.phl.internal [10.202.2.41]) by mailfout.phl.internal (Postfix) with ESMTP id 5937213801EE; Sat, 19 Oct 2024 20:16:29 -0400 (EDT) Original-Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-01.internal (MEProxy); Sat, 19 Oct 2024 20:16:29 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm1; t=1729383389; x=1729469789; bh=3hKUZeHbzWJhr526avBDXrQpmlbm7FY0YHUsL9lYbxA=; b= C6gtRxCULaUx42ICGoeg9qr+RPGHF4B4WQ1BhaiB1MJXPWe9vfG/qo1gHvMyUyDI Kgtx4a9HX2J/ClgiAquSiNgAY73e/+pSEOB5McOHNKTVFbydd8+LsoahQxXHZy8G VVhqvWakHBB7v8stCFp4DfoN94k18nD9liLNjw0g3Ig8qsRxjN2SgqLZCFQshSFv Vh6HV0RvHMwoznzEPTSbKoO9ipP9I8hbdy0JNj59fw/caJwmmk52fHw4og9Hi7Nj oM7ur86z3NNDpiuW6ZGft4PPFVgEJ8QBEulipjL7optbaEZWa4PmE0AtiOFJfMAY Sk5VG9zTJ5AtHbe6Adartg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1729383389; x= 1729469789; bh=3hKUZeHbzWJhr526avBDXrQpmlbm7FY0YHUsL9lYbxA=; b=g rYi85CWQZNaH5gsf2svE3HRTsfg7hMKKl0U3NA4Bye14Ov6bgNjxhFcWWu3d/dJ3 LXCJMSiZiOttOOzlUynUAwu5h8JdPegv9JRIvXh3C4P0o4mRB/yhNEKz7Zl6nztk Mwa/a4gMWJSlYRF60CppuHT21R8MuCSHv+eEpSgxX2q4RAILWx6VVaSb96o//7X3 qJT6VF7Cr30Kb1QF/3l2EJk1rB8UyemDMmexIdoa6J1kboDf2IFvZrHsdTSXoqjr v+Y/kY0qeYMQAJyHYDlj8JQS1aKNXAt5Utx8j2tHT/pwch+O21c20qmNAk5djNkt /I6fFlF8iwI9G701oXfiw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrvdehiedgfeefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnh htshculddquddttddmnecujfgurhepkfffgggfuffvvehfhfgjtgfgsehtjeertddtvdej necuhfhrohhmpeffmhhithhrhicuifhuthhovhcuoegumhhithhrhiesghhuthhovhdrug gvvheqnecuggftrfgrthhtvghrnhepueegkeeifedtkedvleeujeefkeelhefhhfelhfev gfetieejteefffevhfdvtdfgnecuffhomhgrihhnpehsthgrtghkohhvvghrfhhlohifrd gtohhmnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhep ughmihhtrhihsehguhhtohhvrdguvghvpdhnsggprhgtphhtthhopeegpdhmohguvgepsh hmthhpohhuthdprhgtphhtthhopehsphifhhhithhtohhnsehsphifhhhithhtohhnrdhn rghmvgdprhgtphhtthhopehrphhluhhimhesghhmrghilhdrtghomhdprhgtphhtthhope hmohhrghgrnhdrjhdrshhmihhthhesohhuthhlohhokhdrtghomhdprhgtphhtthhopeei gedtheehseguvggssg X-ME-Proxy: Feedback-ID: i07de48aa:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 19 Oct 2024 20:16:27 -0400 (EDT) Content-Language: en-US In-Reply-To: <87jze6vwtx.fsf@melete.silentflame.com> 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:293917 Archived-At: On 18/10/2024 07:50, Sean Whitton wrote: >> So if we determined that its output could be used for editing, perhaps after >> some massaging (e.g. reindenting and keeping only a subset of the headers), >> that could be a minor win -- fewer methods is better in general. I haven't >> tried to code it, so there could be pitfalls. > I thought about it and realised that, for the git case, variables like > vc-git-log-switches and vc-git-shortlog-switches can affect the output, > and could make us misparse it. And ultimately the benefits of avoiding > a new backend method didn't seem to outweigh having parsing code that > could turn out to be fragile. IIUC vc-git-expanded-log-entry is only affected by the former var. We could bind it to nil (that could even be done generically, by looking for all vars called vc-BACKEND-log-switches). But I agree fragility could be a problem. It could also be a win to have one of the methods to be implemented in terms of the other. >> The new vc-git-get-change-comment seems good in terms of functionality. I was >> thinking that the headers such as Author, No-Verify and Sign-Off, might be >> good to show as well, but as long as their values are intact after the edit, >> that's optional. > I thought that it would be nice to include Author, in particular, as you > might need to amend the value. That would require adding additional > arguments to the modify-change-comment action, though, so I left it for > later if someone wants to implement it. I think you're parsing out all the headers from the COMMENT argument in the posted patch, so this paragraph seems to be moot. Like you say in the patch though, it seems changing Author is not supported. To do that, apparently we'd either need to rebase with a pause (with 'git amend' in the middle), or use 'git rebase --exec' like in https://stackoverflow.com/a/79068024/615245. The latter seems like it would apply to all commits in the range, so it might require the same dance as 'amend'. (I can comment on the patch itself tomorrow.)