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

From: Sean Whitton <[email-masked]>
Date: Mon, 21 Oct 2024 09:52:02 +0800

Hello,

On Sun 20 Oct 2024 at 04:52pm +03, Eli Zaretskii wrote:

>> From: Sean Whitton <[email-masked]>
>> Cc: [email-masked],  [email-masked],  [email-masked]
>> Date: Sun, 20 Oct 2024 21:11:00 +0800
>>
>> >> Oh, wait, it wouldn't.  Does it appear in 'C-x v L'?
>> >
>> > Yes.
>>
>> Okay.  Does the message look like this:
>>
>>     amend! <sha1 of the commit whose message you edited>
>>
>>     <your edited message>
>
> Yes.
>
>> If so, then we know that the invocation of 'git commit' is working, and
>> the problem is somewhere else -- probably the invocation of 'git rebase'.
>
> With you, so far.

I think the next thing to do is try the rebase from the command line.
So, please use the debugging version of my patch to create the special
"amend!" commit again, or use the one from yesterday if you still have
it, or you could manually create it by passing --allow-empty to 'git
commit'.

Then, at the command line, use

    git rebase --autosquash -i REV~1

where REV is the sha1 of the commit whose message you intend to edit.

This should open an editor with a rebase plan in which you see

    - the commit whose message you wanted to change
    - followed by the special amend! commit
    - followed by any other commits following the one whose message you wanted to change

i.e. the amend! commit has been pulled down in history to just after the
commit whose message you want to cahnge.

Just save and exit without making any changes to the plan.

After that, the whole process should be complete: you should have the
same commits as previously except the message should have been updated,
and sha1 hashes will have changed.

Let me know if this all works.

-- 
Sean Whitton