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: Sun, 20 Oct 2024 16:59:32 +0800 Message-ID: <871q0brvyj.fsf@melete.silentflame.com> References: <874j59wym3.fsf@melete.silentflame.com> <868qukl73k.fsf@gnu.org> <87bjzfuzaq.fsf@melete.silentflame.com> <867ca3jhsd.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="34104"; 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 Sun Oct 20 11:01:07 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 1t2RoA-0008dN-OR for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 20 Oct 2024 11:01:07 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t2Ro5-0005iS-MF; Sun, 20 Oct 2024 05:01:03 -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 1t2Rni-0005fW-9D for bug-gnu-emacs@gnu.org; Sun, 20 Oct 2024 05:00: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 1t2Rnh-0002Na-F4 for bug-gnu-emacs@gnu.org; Sun, 20 Oct 2024 05:00:37 -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=iR6mTXR87/+hlEbnKOq60t7vnqVwyU88eFLMEAIaqf4=; b=OHyixr+m7828JokVZNx1egmFnrmwxu6dc+OG0aazsbJaZce5NJrRve7NPFc/6C220c41U92p5buzewUu7ITspC2zvipqIc+ME/arXPXSLyKaqe5SHvWAFnJ6sBi1clhVDr+hy3D2mXb4pgUT04/lQMpvQvvmfXhJ7OModLRVi+uMKLk0czFNpS7ni8+wAYqAYqiDHJSyAy5DFDzr/Vh7ZCA/iVD6Xt+22VPHjEkaZnAdC6ftUHP81+pLO0TmPTATn4w5S8wbbdEjyvbyAPtzCMKjq9+u4qkvoBDBCuD03zTKDFEWKqNxq8XOB4km4PB0uZIgPR1TBY1stiP7By42zQ==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1t2Ro6-0003fj-8z for bug-gnu-emacs@gnu.org; Sun, 20 Oct 2024 05:01: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: Sun, 20 Oct 2024 09:01: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.172941481313699 (code B ref 64055); Sun, 20 Oct 2024 09:01:02 +0000 Original-Received: (at 64055) by debbugs.gnu.org; 20 Oct 2024 09:00:13 +0000 Original-Received: from localhost ([127.0.0.1]:45763 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t2RnJ-0003Yr-A8 for submit@debbugs.gnu.org; Sun, 20 Oct 2024 05:00:13 -0400 Original-Received: from sendmail.purelymail.com ([34.202.193.197]:46036) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t2RnG-0003XV-PS for 64055@debbugs.gnu.org; Sun, 20 Oct 2024 05:00:11 -0400 DKIM-Signature: a=rsa-sha256; b=WEn9keyEKVCIKIsEElGbYCoNoB+LxfN2s24WW4u6civQedlqOakrkc6KP6Aik340WwtzCeg/XZ6mOR2aVejLIdnlYVhKrMchUJFuFk1tM8WvCFiJleLbTijc9eeq4ONXMWdl9nPjGe9JnelQTUa4xtBVe7Nf+Zbo6nStmznNrtKasmCp+s0Q7EvbMtk78pcXfLotr9GuuJ00TraiwU9WW2pnCVxUSAFdfAH5PuoXAHWdp2RCm5DeGYRV0/Z0D5M6B0bYraolFXQtPyzoLUmwRle9uAOQeKjoUfu2YgxVgSdnLdhdc0nzn8SCLfN1qBJLh83b6vcA1AKDeTCJnV0QMg==; s=purelymail1; d=spwhitton.name; v=1; bh=tZHuKcsaxd3phYvngOucdNhJVe8jLthndQhCJLJvNBs=; h=Received:Received:From:To:Subject:Date; DKIM-Signature: a=rsa-sha256; b=VsWnI7cPOsYmemyF3R6eZNWnweg5vBlab1iuSES/bXcXHeZfGeegPrducWIJ+L46NRjvcA9l2V6Ml8kW1xjrqKJ+O/wQqn+MzLyFADFZ9rFKAK/AzM5XDTHwuPBPZDxI6TRiU3mQnF1gc3PwsSBVoAa3DzlQCQVLmUnohsBwTZp0IWTHICDEJ8ssBa+CdGf0MFt1yLt80rmH3KrGrMF1cC3dFTx257nwhWIVR+NvEr+CoNBcQ7wbt5Y3x00XqQxBwRKQf//e/6miPdY8WFYgNEIgsgGxBoKJOZSx1AuJAG9IJJIVbj5fEgKE9MyeICBceW08bj2FrWmHGPlCbcWYdA==; s=purelymail1; d=purelymail.com; v=1; bh=tZHuKcsaxd3phYvngOucdNhJVe8jLthndQhCJLJvNBs=; 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 2058858321; (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384); Sun, 20 Oct 2024 08:59:36 +0000 (UTC) Original-Received: by melete.silentflame.com (Postfix, from userid 1000) id 6B0597E8333; Sun, 20 Oct 2024 16:59:32 +0800 (CST) In-Reply-To: <867ca3jhsd.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 20 Oct 2024 11:32:50 +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:293939 Archived-At: Hello, On Sun 20 Oct 2024 at 11:32am +03, Eli Zaretskii wrote: > So someone will have to test the patch on Windows with a new en ough > Git version. I don't think so -- the code to support Windows is independent of the code to support older Git. So, my tests here on GNU/Linux with newer Git, together with yours on Windows with older Git, are sufficient. >> I think we can support older by stashing and unstashing. So please try >> the attached patch, which does that. > > This seems to work without any errors, and the *vc* buffer says > > Successfully rebased and updated refs/heads/master. > > But the log message is not updated, neither in the *vc-change-log* > buffer nor if I manually invoke "git log" from the shell prompt. It > sounds like the commit message was not amended. "git stash list" also > shows no relevant stashes. > > Let me know how can I help you debug this. Thank you for testing it. Let's try commenting out everything except the 'git commit', as done in the following diff on top of my patch. Please test this without anything staged. Does it create a new commit at the tip of your branch? The contents of the commit should be a special first line, followed by your amended commit message. If not: I've also commented out the deletion of the temporary file, and sent its name to *Messages*. If you look in that temporary file, do you find your amended commit message? --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--- -- Sean Whitton