all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Sean Whitton <spwhitton@spwhitton.name>
To: Eli Zaretskii <eliz@gnu.org>
Cc: Morgan.J.Smith@outlook.com, 64055@debbugs.gnu.org, dgutov@yandex.ru
Subject: bug#64055: Implementation of modifying VC change comments for Git
Date: Sun, 20 Oct 2024 16:59:32 +0800	[thread overview]
Message-ID: <871q0brvyj.fsf@melete.silentflame.com> (raw)
In-Reply-To: <867ca3jhsd.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 20 Oct 2024 11:32:50 +0300")

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





  reply	other threads:[~2024-10-20  8:59 UTC|newest]

Thread overview: 75+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-13 22:59 bug#64055: [WIP Patch] Enable editing commit messages - vc-git-modify-change-comment Morgan Smith
2023-06-14  8:00 ` Robert Pluim
2023-06-14 11:41   ` Morgan Smith
2023-06-14 13:13     ` Robert Pluim
2023-06-14 13:54       ` Morgan Smith
2023-06-14 15:30         ` Robert Pluim
2024-10-01  2:38       ` Sean Whitton
2024-10-01 19:32         ` Dmitry Gutov
2024-10-02  0:01           ` Sean Whitton
2024-10-02 23:20             ` Dmitry Gutov
2024-10-10  2:39               ` Sean Whitton
2024-10-10  2:48                 ` Sean Whitton
2024-10-17 13:27                   ` Sean Whitton
2024-10-18  5:26                     ` Eli Zaretskii
2024-10-18  6:20                       ` Sean Whitton
2024-10-18  9:14                         ` Eli Zaretskii
2024-10-18  9:30                           ` Sean Whitton
2024-10-18 12:18                             ` Eli Zaretskii
2024-10-20  0:56                               ` Sean Whitton
2024-10-20  4:58                                 ` Eli Zaretskii
2024-10-20  5:29                                   ` Sean Whitton
2024-10-20  6:09                                     ` Eli Zaretskii
2024-10-20  7:18                                       ` Sean Whitton
2024-10-20  8:20                                         ` Eli Zaretskii
2024-10-20  8:42                                           ` Sean Whitton
2024-10-20  8:56                                             ` Eli Zaretskii
2024-10-18  0:46                 ` Dmitry Gutov
2024-10-18  4:50                   ` Sean Whitton
2024-10-20  0:16                     ` Dmitry Gutov
2024-10-20  0:58                       ` Sean Whitton
2023-06-17  2:40 ` Dmitry Gutov
2024-10-01  2:37   ` Sean Whitton
2024-10-01 13:35     ` Dmitry Gutov
2024-10-10  2:45 ` Sean Whitton
2024-10-10  6:12   ` Eli Zaretskii
2024-10-10  6:23     ` Sean Whitton
2024-10-10  7:36       ` Eli Zaretskii
2024-10-10  7:46         ` Sean Whitton
2024-10-18  9:26 ` bug#64055: Implementation of modifying VC change comments for Git Sean Whitton
2024-10-19 10:28   ` Eli Zaretskii
2024-10-20  5:19     ` Sean Whitton
2024-10-20  8:32       ` Eli Zaretskii
2024-10-20  8:59         ` Sean Whitton [this message]
2024-10-20  9:19           ` Eli Zaretskii
2024-10-20  9:25             ` Sean Whitton
2024-10-20  9:46               ` Sean Whitton
2024-10-20 11:24                 ` Eli Zaretskii
2024-10-20 13:11                   ` Sean Whitton
2024-10-20 13:52                     ` Eli Zaretskii
2024-10-21  0:01                       ` Dmitry Gutov
2024-10-21  1:45                         ` Sean Whitton
2024-10-21  5:27                         ` Eli Zaretskii
2024-10-21  1:52                       ` Sean Whitton
2024-10-21 13:48                         ` Eli Zaretskii
2024-10-22  8:25                           ` Sean Whitton
2024-10-22 13:27                             ` Eli Zaretskii
2024-10-22 13:42                               ` Sean Whitton
2024-10-22 14:20                                 ` Eli Zaretskii
2024-10-22 14:52                                   ` Sean Whitton
2024-10-20 11:18               ` Eli Zaretskii
2024-10-20 23:55       ` Dmitry Gutov
2024-10-21  2:10         ` Sean Whitton
2024-10-21  0:09       ` Dmitry Gutov
2024-10-21  2:01         ` Sean Whitton
2024-10-21  5:39           ` Eli Zaretskii
2024-10-21  5:46             ` Sean Whitton
2024-10-21  5:49               ` Eli Zaretskii
2024-10-21 19:56               ` Dmitry Gutov
2024-10-22  8:29                 ` Sean Whitton
2024-10-21 20:08       ` Dmitry Gutov
2024-10-22  8:30         ` Sean Whitton
2024-10-26  1:58       ` Dmitry Gutov
2024-10-26  3:12         ` Sean Whitton
2024-10-27  1:05           ` Dmitry Gutov
2024-10-27  2:25             ` Sean Whitton

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=871q0brvyj.fsf@melete.silentflame.com \
    --to=spwhitton@spwhitton.name \
    --cc=64055@debbugs.gnu.org \
    --cc=Morgan.J.Smith@outlook.com \
    --cc=dgutov@yandex.ru \
    --cc=eliz@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.