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

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: Sean Whitton <spwhitton@HIDDEN>; dated Mon, 8 Sep 2025 11:28:02 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 8 Sep 2025 11:27:35 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Sep 08 07:27:35 2025
Received: from localhost ([127.0.0.1]:50035 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1uva22-0000ly-Lu
	for submit <at> debbugs.gnu.org; Mon, 08 Sep 2025 07:27:35 -0400
Received: from lists.gnu.org ([2001:470:142::17]:40384)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <spwhitton@HIDDEN>)
 id 1uva1v-0000lK-4J
 for submit <at> debbugs.gnu.org; Mon, 08 Sep 2025 07:27:31 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10])
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <spwhitton@HIDDEN>)
 id 1uva1o-00063e-Qr
 for bug-gnu-emacs@HIDDEN; Mon, 08 Sep 2025 07:27:21 -0400
Received: from sendmail.purelymail.com ([34.202.193.197])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <spwhitton@HIDDEN>)
 id 1uva1h-00046i-I5
 for bug-gnu-emacs@HIDDEN; Mon, 08 Sep 2025 07:27:20 -0400
DKIM-Signature: a=rsa-sha256;
 b=GZrBM2W8g026HA1lEFcDDrmGfFlH/DF2es2AsJoBzlWABieAHRIfn7wcwrrRZ+nNc2BJgI9qh9Afl7kx9yDzkYFOXSo+U90xKqntog1gk+29tvOrPNWDCCdAUN8gQxlFKHwWf4G9c7Z7SRv5QrJ906f8hIZs/LtU4TXStMQyGUxj5fdlfE3f3mADRIsl6c7V1q3nfA6q28bSUAhDvbbcqDcdsHOZ/w99dGxRz9OKPWMD9XLyuvYmKXpgMeoSr49dYjt2v3aILcQPGDcoD2fyScBRXaAHYfek5H1wiq7qmgUtVh18UA1N+UD4dp6jzxjilvRt/mcJmIpZ55qrvEZaiA==;
 s=purelymail2; d=spwhitton.name; v=1;
 bh=rQNeZI07NmJAvyKmKa0tJqYJv10FNoRioCzS4ZCMxm0=;
 h=Received:Received:From:To:Subject:Date; 
DKIM-Signature: a=rsa-sha256;
 b=KLokBcKvOYgogF5rTBMbGg6J1dTmHmsmMiRjQPdJn2G92DcgTxSxuoA8mS9BkJJI0ttcxfMM6+C2yd9YUdnwphriBjOxume1DBylxniHEElvh+eHsA2knPFp20estK2D7gjMrGPoEpFJYnR6uSkK2sCLhO2a51DGIgc7J+o/GGI1JANEv7UhT3F8n3Iy/ii53aEkSg0pGIZyO5Kpej2TQ4yJh8vm0tQ3vKfQMmNYGHN0PkEVuaMwu2zjkkr1fZ/HxOokZeCuFGFVixb35fqt/XzQGE28Rxk5MfEcW1a508mmnlD6Qzc54YAGAXmuLGFiXeGnqJgXMntAkTvlI+qWMw==;
 s=purelymail2; d=purelymail.com; v=1;
 bh=rQNeZI07NmJAvyKmKa0tJqYJv10FNoRioCzS4ZCMxm0=;
 h=Feedback-ID:Received:Received:From:To:Subject:Date; 
Feedback-ID: 20115:3760:null:purelymail
X-Pm-Original-To: bug-gnu-emacs@HIDDEN
Received: by smtp.purelymail.com (Purelymail SMTP) with ESMTPSA id -983027225
 for <bug-gnu-emacs@HIDDEN>
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Mon, 08 Sep 2025 11:27:03 +0000 (UTC)
Received: by zephyr.silentflame.com (Postfix, from userid 1000)
 id 8DB83940466; Mon, 08 Sep 2025 12:27:02 +0100 (BST)
From: Sean Whitton <spwhitton@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: 31.0.50; VC commands for cherry-picking
Date: Mon, 08 Sep 2025 12:27:02 +0100
Message-ID: <87a535mbg9.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain
Received-SPF: pass client-ip=34.202.193.197;
 envelope-from=spwhitton@HIDDEN; helo=sendmail.purelymail.com
X-Spam_score_int: -20
X-Spam_score: -2.1
X-Spam_bar: --
X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,
 RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001,
 RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001,
 SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: 1.0 (+)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.0 (/)

X-debbugs-cc: eliz@HIDDEN, sbaugh@HIDDEN, dmitry@HIDDEN, juri@HIDDEN

Hello,

I'd like to add VC commands to cherry-pick changes.
These are my proposed additions to the VC API:

;; - cherry-pick (files comment rev reverse)
;;
;;   Copy a REV's changes, log message, author and author timestamp as a
;;   new commit on the current branch.  If REVERSE, reverse REV's changes.
;;   FILES is for forward-compatibility; existing implementations aren't
;;   able to limit the changes copied from REV to those made to FILES.
;;
;; - cherry-apply (files rev reverse)
;;
;;   Copy REV's changes to FILES to this working directory.  If REVERSE,
;;   reverse REV's changes.  (When REVERSE is nil, typically REV will be
;;   a revision from another branch.)
;;
;; - cherry-pick-comment (files rev reverse)
;;
;;   Return a string to be appended to the log message when
;;   cherry-picking REV onto another branch.  This is Git's "(cherry
;;   picked from commit ...)" and Mercurial's "(grafted from ...)",
;;   or if REVERSE, Git's "This reverts commit ...".
;;   FILES is for forward-compatibility; existing implementations care
;;   only about REV.

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).
 - On C-c C-c, calls the cherry-pick API function for the backend to do
   the cherry-pick.
   Examples: vc-git-cherry-pick would invoke 'git cherry-pick' or
   'git revert' depending on whether REVERT.
   vc-hg-cherry-pick would invoke 'hg graft' or 'hg backout'.

 Will have vc-checkin's COMMENT, INITIAL-CONTENTS arguments so calling
 from Lisp can skip the Log Edit session.

 A prefix argument might toggle whether to append the cherry-pick
 comment.

 We'll be expecting the user to invoke this from Log View mode.  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.

vc-undo-revision (vc-revert is taken):
 Same as vc-cherry-pick, except passes REVERSE non-nil at the
 appropriate points.  No prefix argument.

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.

I think this is a good way to divide up the functionality on the
frontend, but I'm open to suggestions.  Thanks!

-- 
Sean Whitton




Acknowledgement sent to Sean Whitton <spwhitton@HIDDEN>:
New bug report received and forwarded. Copy sent to eliz@HIDDEN, sbaugh@HIDDEN, dmitry@HIDDEN, juri@HIDDEN, bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to eliz@HIDDEN, sbaugh@HIDDEN, dmitry@HIDDEN, juri@HIDDEN, bug-gnu-emacs@HIDDEN:
bug#79408; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Mon, 8 Sep 2025 11:30:02 UTC

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