GNU bug report logs - #79408
31.0.50; VC commands for cherry-picking

Previous Next

Package: emacs;

Reported by: Sean Whitton <spwhitton <at> spwhitton.name>

Date: Mon, 8 Sep 2025 11:28:02 UTC

Severity: normal

Found in version 31.0.50

Full log


View this message in rfc822 format

From: Sean Whitton <spwhitton <at> spwhitton.name>
To: Juri Linkov <juri <at> linkov.net>
Cc: dmitry <at> gutov.dev, eliz <at> gnu.org, 79408 <at> debbugs.gnu.org, sbaugh <at> janestreet.com
Subject: bug#79408: 31.0.50; VC commands for cherry-picking
Date: Tue, 09 Sep 2025 10:57:16 +0100
Hello,

On Mon 08 Sep 2025 at 09:34pm +03, Juri Linkov wrote:

>> These are my proposed commands:
>>
>> vc-cherry-pick:
>>  - Gets the log message for REV with get-change-comment API function.
>>  - Gets the string to append with cherry-pick-comment API function.
>>  - Puts these together, starts a Log Edit session for the user to amend
>>    the message (e.g. for Git, doing C-c C-s to add a sign-off).
>
> Will 'C-c C-d' be supported to show diff from the Log Edit buffer?

Yes, it should be no problem to support that.

>>  We'll be expecting the user to invoke this from Log View mode.
>
> I guess the basic workflow would be to view a branch log
> with e.g. 'C-x v b l', then after marking the required commits
> invoke the new commands.

Right.

>>  If multiple commits are marked, then I think we have to skip the Log Edit
>>  session, for now, because we don't have a nice way to prompt for
>>  multiple messages.
>
> Maybe even for the single commit 'vc-cherry-pick' could ask
> for confirmation (maybe with a multiple choice), and optionally
> commit straight away without showing a Log Edit buffer.

I would say that is a bit complex, because just typing C-c C-c
immediately is not a lot of effort.

>> vc-cherry-apply:
>>  The advantage of having a backend API function for this is that the
>>  backend can use its full merging logic.
>>  A generic vc-default-cherry-apply can be implementated similarly to
>>  vc-apply-to-other-working-tree.
>>
>> vc-undo-apply:
>>  Like vc-cherry-apply except passes REVERSE non-nil at the appropriate
>>  point.  Similarly there can be a vc-default-reverse-cherry-apply.
>
> Are the last two commands equivalent to showing diff and invoking
> 'C-c RET a' on it, with or without the prefix argument REVERSE?

Yes, except that using 'C-c RET a' uses Emacs's merging logic, which may
be less sophisticated than the backend's.  Hmm.  Maybe I should skip
those commands for now.  What do you think?

-- 
Sean Whitton




This bug report was last modified today.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.