Subject: Re: bug#79408: 31.0.50; VC commands for cherry-picking

From: Juri Linkov <[email-masked]>
Date: Tue, 09 Sep 2025 21:01:36 +0300

>>> This reminded me of how we don't have a way to do format-patch using vc;
>>> that's somewhat related, and would be nice to support.
>>
>> We do!  'M-x vc-prepare-patch' is the interactive entry point.
>
> Ah, right.  I never use that because I always interact with Emacs
> development via Gnus, mostly via debbugs.el, and I just manually attach
> patches to my emails.  (debbugs.el also has some way to format a patch
> but I've never gotten it to work)

We still miss the command with a name like 'vc-attach-patch'
that would attach a marked revision to the current message.

>>> In fact, I wonder if perhaps:
>>>
>>> - a new format-patch backend function

The existing backend function 'prepare-patch' already uses
format-patch in 'vc-git-prepare-patch'.

> The VCS would still be (basically) handling the whole thing.  I'm
> suggesting that we basically just run:
>
> git format-patch | git am
>
> or:
>
> hg import | hg export
>
> Which (I think) is how cherry-picking works under the hood historically
> in git anyway.

Using backend commands to do the work would be more reliable.
Then as post-processing we need to update already visited buffers.