Subject: Re: Implementation of modifying VC change comments for Git

From: Eli Zaretskii <[email-masked]>
Date: Tue, 22 Oct 2024 17:20:43 +0300

> From: Sean Whitton <[email-masked]>
> Cc: [email-masked],  [email-masked],  [email-masked]
> Date: Tue, 22 Oct 2024 21:42:33 +0800
> 
> - Manually create a temporary file somewhere outside the repository;
>   I'll refer to its absolute file name as TEMP.
> 
> - Put the commit message for ORIG-REV into the temporary file.
> 
> - Modify that commit message to include the Unicode, or whatever.
> 
> - Prepend "amend! <sha1 of ORIG-REV>\n\n".  So for example:
> 
> --8<---------------cut here---------------start------------->8---
> amend! 212cf3125611b123707feac6f7ffd55a230bc568
> 
> Make all the entries in 'eshell-parse-argument-hook' named functions
> 
> * lisp/eshell/esh-arg.el (eshell-parse-number, eshell-parse-non-special)
> (eshell-parse-whitespace, eshell-parse-comment): New functions...
> (eshell-parse-argument-hook): ... use them.   אבגד ą ě č
> --8<---------------cut here---------------end--------------->8---
> 
> - Save the temporary file.
> 
> - Ensure there are no staged changes.
>   ('git reset' with no arguments should do it)
> 
> - git commit --allow-empty -F TEMP
> 
> - git rebase --autosquash -i ORIG-REV~1

This last step shows the following (again, indented 2 columns by me):

  pick bf73d7e Foobar with some Unicode אבגד ą ě č
  # pick d796890ee8cc77ac899954c3e94e5257c5f72615 amend! bf73d7e036c5d80cdd112f34255a0ab1ea697c07

  # Rebase 6c6ea73..d796890 onto 6c6ea73 (1 command)
  #
  # Commands:
  # p, pick = use commit
  # r, reword = use commit, but edit the commit message
  # e, edit = use commit, but stop for amending
  # s, squash = use commit, but meld into previous commit
  # f, fixup = like "squash", but discard this commit's log message
  # x, exec = run command (the rest of the line) using shell
  # d, drop = remove commit
  #
  # These lines can be re-ordered; they are executed from top to bottom.
  #
  # If you remove a line here THAT COMMIT WILL BE LOST.
  #
  # However, if you remove everything, the rebase will be aborted.
  #
  # Note that empty commits are commented out

And if I type "C-x #" to exit, without changing the above in any way
(since you didn't tell me to change anything), I'm back at ORIG-REV
with its original log message.  IOW, the editing of the commit log
message failed.