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: Implementation of modifying VC change comments for Git Date: Tue, 22 Oct 2024 16:25:52 +0800 Message-ID: <87y12gfsrz.fsf@melete.silentflame.com> References: <874j59wym3.fsf@melete.silentflame.com> <868qukl73k.fsf@gnu.org> <87bjzfuzaq.fsf@melete.silentflame.com> <867ca3jhsd.fsf@gnu.org> <871q0brvyj.fsf@melete.silentflame.com> <8634krjfmo.fsf@gnu.org> <87bjzfqg7d.fsf@melete.silentflame.com> <878qujp0mq.fsf@melete.silentflame.com> <86y12jhva6.fsf@gnu.org> <87o73eor6j.fsf@melete.silentflame.com> <86r08aj2yz.fsf@gnu.org> <87wmi2kyt9.fsf@melete.silentflame.com> <86a5exh8ib.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="28664"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Morgan.J.Smith@outlook.com, 64055@debbugs.gnu.org, dgutov@yandex.ru To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Oct 22 10:26:54 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 1t3AE9-0007Gj-T8 for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 22 Oct 2024 10:26:54 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t3ADv-0007Vn-Pf; Tue, 22 Oct 2024 04:26:39 -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 1t3ADs-0007VH-Ba for bug-gnu-emacs@gnu.org; Tue, 22 Oct 2024 04:26:37 -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 1t3ADq-0000Dm-HY for bug-gnu-emacs@gnu.org; Tue, 22 Oct 2024 04:26:35 -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=Y7KDtivjI9iy7bhM9chgDBM3T9WmEP27SwnxsGO7/CY=; b=WpmXAslcByuk1xfcPxeuzozt4QtBFlNkmMqUHpeQMIWdRwy6nDN5mfChE+sby7K8MhOKn9tJQ0xd+xB1/a8fT0nyeDITk72JcFk5BJBp16MoSu81O0cWrxqjQrPe1JsTmG32Wl8AfPN78rYzyI7pCOLczKAtTKsOZxkPEyGcYjsT9IGwTgCs80rE7iHD81tkti864WFfN4pMHP2fM6nnFlVReR/UB/P1FH/YF30uz4N0bws82ZYV3FlVD8cttTRxw5OTvaJscEVZfIxxl+SQjoyPYzvE+6s4FHR6VN5Zhnz7Vl1Nxq0KkMkHrPmri7uA6aIE2jicfKFcubdC4XFoJA==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1t3AEI-0005X8-2S for bug-gnu-emacs@gnu.org; Tue, 22 Oct 2024 04:27: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: Tue, 22 Oct 2024 08:27: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.172958559921236 (code B ref 64055); Tue, 22 Oct 2024 08:27:02 +0000 Original-Received: (at 64055) by debbugs.gnu.org; 22 Oct 2024 08:26:39 +0000 Original-Received: from localhost ([127.0.0.1]:54549 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t3ADs-0005WM-2k for submit@debbugs.gnu.org; Tue, 22 Oct 2024 04:26:39 -0400 Original-Received: from sendmail.purelymail.com ([34.202.193.197]:53148) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t3ADn-0005W4-7b for 64055@debbugs.gnu.org; Tue, 22 Oct 2024 04:26:35 -0400 DKIM-Signature: a=rsa-sha256; b=ELH8PXJ9jOYF3FCqhO+nHpyN0gN/HNrUrRzSG/KLjScH7aiwPWKK6kDW9ClrP0ABU/3QJ9yS3YjPTAcb4LXn2vaEfYx6xlzd1xr1zE+VWYRpHEUYcOd5SIXa1ctS6hjkCykp3LUQwEuqDUGIYyY6QLA7X3jT81lEbgGa5iSZuTNBEhgZ0PlSvwNdbF2r5BICICPp00dbIq/i3h2mB2iGHUg5mCU8jp5ixgqtRuBxUFo1xszpC2xpKUr6j7ESuKE4qV2o6uI0OF4mGjwrAIVfDSpGJqPQUgDcQDRA0U474VJjrnTyGbnNxnjG0+bZ1Yjqcckm7BLETfKSnsBwEt7r/A==; s=purelymail2; d=spwhitton.name; v=1; bh=nBm3anQ0fVhO1hv9lEsZqjV/49EFq5VYhQe3oYV0eNE=; h=Received:Received:From:To:Subject:Date; DKIM-Signature: a=rsa-sha256; b=Ky84kHn2pnRF4mTari6E9jgNGfR9NKlsgpy5qp0+BCVram+DSNjKETkKybjQGv0DEFykZ4MATIP3h/ggDabxw6+DDLWbExMhH/DFoxii6/PRXlzW0O5Kci0vNVJf2wJI7FjDXJbzY22KYODZj8hYzW4RKAvPS6LMAvn2KWj9njRCVyGcU3MiHNlp/N3OB/uiItnl4agPENM9kOVR2/6/tJYaHaHmKP3lym8T0dIEU45ps3ERMKHVav1kMDT32I8fYuMGV+6tcXwY97xQ5t7WyANI0opKQcpy2/gHKBjBWQ1yIgEKnmDUC8xDWVL51yNaqFUe/aKb5beQHqX+x9p6dg==; s=purelymail2; d=purelymail.com; v=1; bh=nBm3anQ0fVhO1hv9lEsZqjV/49EFq5VYhQe3oYV0eNE=; 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 -1151163291; (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384); Tue, 22 Oct 2024 08:25:56 +0000 (UTC) Original-Received: by melete.silentflame.com (Postfix, from userid 1000) id 675BC7EAD05; Tue, 22 Oct 2024 16:25:52 +0800 (CST) In-Reply-To: <86a5exh8ib.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 21 Oct 2024 16:48:28 +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:294093 Archived-At: Hello, Thanks for trying the manual rebase. On Mon 21 Oct 2024 at 04:48pm +03, Eli Zaretskii wrote: > But let me describe what I did and saw, to make sure I did it > correctly. > >> git rebase --autosquash -i REV~1 >>=20 >> where REV is the sha1 of the commit whose message you intend to edit. > > At this point "git log" shows a revision with my amended log message > (let's call this AMENDED-REV), followed by the revision with the > original log message (let's call it ORIG-REV). So my Git command > looks like this: > > git rebase --autosquash -i ORIG-REV~1 > > After this step, I see this in the editor (where I indented the text > by 2 columns): > > pick bf73d7e Foobar with some Unicode =D7=90=D7=91=D7=92=D7=93 =C4=85 = =C4=9B =C4=8D > # pick bc3c567b2b136d040fd13373b6594c1ec026fec6 Foobar with some Unicod= e =D7=90=D7=91=D7=92=D7=93 =C4=85 =C4=9B =C4=8D There are two things about this output that are unexpected to me: - The first line of the AMENDED-REV message does not appear to start with "amend!". I thought that you confirmed in a previous message that the commit messsage of AMENDED-REV did have this structure: amend! - The line for the AMENDED-REV message is commented out. That means that git-rebase proposes to drop the commit. I would guess that git wants to drop it because it introduces no content changes. > Does this mean it didn't work? or did I misinterpret the steps? I think that there are two possibilities. If you lost the magic "amend!" commit then please try again with an AMENDED-REV whose commit message has the special "amend!" structure. You can create one manually by passing --allow-empty to git-commit, or you can use the previous version of my patch with everything except the call to git-commit commented out -- here's the diff doing the commenting-out again, if you need it. On the other hand, if your AMENDED-REV does have the special "amend!" structure, then I think we have to conclude that the older Git you have does not support these special "amend!" commits at all, and so we can't support it for log-view-modify-change-comment. --8<---------------cut here---------------start------------->8--- diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el index 59d5386bc72..d2ada63f71e 100644 --- a/lisp/vc/vc-git.el +++ b/lisp/vc/vc-git.el @@ -2042,8 +2042,8 @@ vc-git-modify-change-comment ;; % git commit --allow-empty -m... ;; % git rebase --autosquash -i REV~1 ;; % git stash pop - (unless nothing-staged - (vc-git-command nil 0 nil "stash" "push")) + ;; (unless nothing-staged + ;; (vc-git-command nil 0 nil "stash" "push")) (unwind-protect (progn (when (cl-intersection '("--author" "--date") args @@ -2064,12 +2064,15 @@ vc-git-modify-change-comment (list "-m" message)) args))) (when (and msg-file (file-exists-p msg-file)) - (delete-file msg-file))) - (with-environment-variables (("GIT_SEQUENCE_EDITOR" "true")) - (vc-git-command nil 0 nil "rebase" "--autosquash" "-i" - (format "%s~1" rev))) - (unless nothing-staged - (vc-git-command nil 0 nil "stash" "pop" "--index")))) + ;; (delete-file msg-file) + )) + ;; (with-environment-variables (("GIT_SEQUENCE_EDITOR" "true")) + ;; (vc-git-command nil 0 nil "rebase" "--autosquash" "-i" + ;; (format "%s~1" rev))) + ;; (unless nothing-staged + ;; (vc-git-command nil 0 nil "stash" "pop" "--index")) + (message "temporary file is: %s" msg-file) + )) (defvar vc-git-extra-menu-map (let ((map (make-sparse-keymap))) --8<---------------cut here---------------end--------------->8--- --=20 Sean Whitton