From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Sean Whitton Newsgroups: gmane.emacs.bugs Subject: bug#64055: [WIP Patch] Enable editing commit messages - vc-git-modify-change-comment Date: Fri, 18 Oct 2024 12:50:18 +0800 Message-ID: <87jze6vwtx.fsf@melete.silentflame.com> 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> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="28486"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Morgan Smith , Robert Pluim , 64055@debbugs.gnu.org To: Dmitry Gutov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Oct 18 06:51:20 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 1t1exL-0007BS-Fn for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 18 Oct 2024 06:51:19 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t1ewn-0008OT-4Z; Fri, 18 Oct 2024 00:50:45 -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 1t1ewi-0008O5-Td for bug-gnu-emacs@gnu.org; Fri, 18 Oct 2024 00:50:41 -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 1t1ewi-0003Tf-Ka for bug-gnu-emacs@gnu.org; Fri, 18 Oct 2024 00:50:40 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:References:In-Reply-To:From:To:Subject; bh=FOQLIei7+nGqDY5dOt9t1Nprjq786RZmpVEpM5+cwN4=; b=ptuPQ0oCvVc3gYyAm/PLd/5n1VUCJHJxRMnAg0dK2t7AvCT67OD1xAkRoq28VQshJoPJZHlBJaQ65zl1YyVW4cLDdrVJjJiStnTphu/2BlQto/WrBum/CYq4ykyZroi/7E3GpKbHPtQlMvZKHZYbQ6Z8VpG8OqwNe8BY0/YSwg35m9qMJWnbXMY1KuH9G22Osxl0y2HrXDiggK72SobCIw1a1qv1JonxhkU7NP23sVTQKjas9BY8vOjNiuyhFiOSYsf/5pomsY00eJTYjwnPld3ZD7hZdPxOSw26N3Z2p8HmT9WWLOS1oaUDP9mI0bCJ5gnuyRVzsxdufF7Jn908iQ==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1t1ex4-0000bq-3t for bug-gnu-emacs@gnu.org; Fri, 18 Oct 2024 00:51:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Sean Whitton Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 18 Oct 2024 04:51:02 +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.17292270562331 (code B ref 64055); Fri, 18 Oct 2024 04:51:02 +0000 Original-Received: (at 64055) by debbugs.gnu.org; 18 Oct 2024 04:50:56 +0000 Original-Received: from localhost ([127.0.0.1]:36638 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t1ewy-0000bX-9L for submit@debbugs.gnu.org; Fri, 18 Oct 2024 00:50:56 -0400 Original-Received: from sendmail.purelymail.com ([34.202.193.197]:33976) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t1ewv-0000bG-IJ for 64055@debbugs.gnu.org; Fri, 18 Oct 2024 00:50:54 -0400 DKIM-Signature: a=rsa-sha256; b=GVlLGSq52diPyBCPbXry3l/c1sENGp/O4S/2hpE/H70DaVVHasOEQ4W+iEkXjmcn2ZlD9X9bC3VngPx329juZiQvLu1WUJ90JpZ86iAXB5AKJW2siepxvtEQdgUDGM1h+wNw4QBjk3ueVLKbRUZYKdhwzA4nVX7fkUqXe9U/R8pDYwbBAL9fWht5/yJXTjAaPHHTZ2AITIK+nTWsjKyjnK7bYx5oowR8HvPPq/bZazCileiI5BVxg5QUdAyMAJxtUA07yJzlKapxrmbuM3W04ppoe/7kGMRyYKx9n6hgJ9FH90BgUHSguEC3soceWF5MBreBlio2myv8qBX73g8IxA==; s=purelymail1; d=spwhitton.name; v=1; bh=1GVK7as1rgrSsZfQhubSu9dSKY9x6Qkk/GlFRafIlg4=; h=Received:Received:From:To:Subject:Date; DKIM-Signature: a=rsa-sha256; b=X08QOWxWmipg2OfVhrSQ+altXyjZF2pT1Idts50tSDMZxa4TqQOzvsVn0h4YnsTqzhrlpcYlGynEjtIr5+4A827eqTAOGDEu1CKR2yjDs9zA8UVqLXtp4c7+mela4Q2tf4p5oNSotNRftakr1KFDbznP7hNM7u4J+sEOrkiHm9PtbwEoa2KFQt0i8VIq2pXJSTMGDtsQCM3EB5TQgd4SpI1c8iLd1MpMfTJEVLL8J5OPd8D0U4vsnwTy9dejMyV0z3ohnURRaIrTZoqQ6eBDOrCsKsMXi2XNtYMv7shpJA7+jBe+3kXNwpZc2NGJIL9LiGk571H8ihJnzytWt5p+Rg==; s=purelymail1; d=purelymail.com; v=1; bh=1GVK7as1rgrSsZfQhubSu9dSKY9x6Qkk/GlFRafIlg4=; h=Feedback-ID:Received:Received:From:To:Subject:Date; Feedback-ID: 20115:3760:null:purelymail X-Pm-Original-To: 64055@debbugs.gnu.org Original-Received: by smtp.purelymail.com (Purelymail SMTP) with ESMTPSA id 1895773447; (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384); Fri, 18 Oct 2024 04:50:21 +0000 (UTC) Original-Received: by melete.silentflame.com (Postfix, from userid 1000) id B0E527EAC38; Fri, 18 Oct 2024 12:50:18 +0800 (CST) In-Reply-To: (Dmitry Gutov's message of "Fri, 18 Oct 2024 03:46:36 +0300") 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:293758 Archived-At: Hello, On Fri 18 Oct 2024 at 03:46am +03, Dmitry Gutov wrote: > Hi! Sorry for the late reply, I've been driving a lot the last week. Oh, no problem. > On 10/10/2024 05:39, Sean Whitton wrote: >> In Dmitry's patch he takes the approach of calling the >> expanded-log-entry backend function to get the message to edit. >> This is not a real VC backend function -- in fact it's a log-view >> feature, log-view-expanded-log-entry-function. > > It is, but it is also basically a backend method, i.e. in vc-git.el: > > (setq-local log-view-expanded-log-entry-function > 'vc-git-expanded-log-entry)) > > 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. > Also note that we have 'rfc822-goto-eoh' which can be used to skip to the end > of the headers. 'log-edit-extract-headers' could be used as reference for > extracting "Summary", even if it doesn't exactly give us the desired info now. Those aren't VC-specific, though, they're based on how Log Edit works for all backends. So although it's fiddly parsing, it can be done the same way always, at least. > 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'm not sure how No-Verify would interact with the --fixup=reword: commits we are now planning to use. Sign-Off would be useful for using the new feature to insert a missing sign-off. >> I think, though, that there might be subtle complexities there. For >> example, should there be a FILES argument, or just a REVISION argument? >> For Git and Hg it's just REVISION, but we wouldn't want to bake that in. > > Makes sense, e.g. if we end up supporting per-file backends later. Right. -- Sean Whitton