GNU bug report logs - #71461
30.0.50; Want VC command to view a single revision like a patch

Previous Next

Package: emacs;

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

Date: Mon, 10 Jun 2024 08:26:01 UTC

Severity: normal

Found in version 30.0.50

Done: Sean Whitton <spwhitton <at> spwhitton.name>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 71461 in the body.
You can then email your comments to 71461 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to juri <at> linkov.net, dmitry <at> gutov.dev, bug-gnu-emacs <at> gnu.org:
bug#71461; Package emacs. (Mon, 10 Jun 2024 08:26:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Sean Whitton <spwhitton <at> spwhitton.name>:
New bug report received and forwarded. Copy sent to juri <at> linkov.net, dmitry <at> gutov.dev, bug-gnu-emacs <at> gnu.org. (Mon, 10 Jun 2024 08:26:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Sean Whitton <spwhitton <at> spwhitton.name>
To: bug-gnu-emacs <at> gnu.org
Subject: 30.0.50; Want VC command to view a single revision like a patch
Date: Mon, 10 Jun 2024 16:00:44 +0800
X-debbugs-cc: juri <at> linkov.net, dmitry <at> gutov.dev

Hello,

I do security work which involves backporting specific upstream commits
to older versions of the software.  I often end up with a list of
revision hashes and I use 'git cherry-pick -x' to grab them.

While resolving conflicts, I often just want to look at a summary of a
single revision.  I want to see the revision's root diff, and sometimes
also its log message.

This isn't very easy with VC at present.  There is
    C-x v b L <revision> RET =
and
    C-u C-x v D <revision>~1 RET <revision> RET
but neither are very nice (and the latter requires you to specify the
previous revision using VCS-specific notation).

Could we add a backend-generic command for this?
And might we bind it under 'C-x v' ?

I came up with the following as a start; it's not great.

--8<---------------cut here---------------start------------->8---
(defun vc-root-revision (rev)
  (interactive (list (vc-read-revision "Revision to show: ")))
  (let ((patch (vc-call-backend (vc-responsible-backend default-directory)
				'prepare-patch rev))
	(buf (get-buffer-create "*vc-revision*")))
    (set-buffer buf)
    (let ((inhibit-read-only t))
      (erase-buffer)
      (insert-buffer-substring (plist-get patch :buffer)
			       (plist-get patch :body-start)
			       (plist-get patch :body-end)))
    (setq buffer-read-only t)
    (diff-mode)
    (pop-to-buffer buf)
    (goto-char (point-min))))
--8<---------------cut here---------------end--------------->8---

-- 
Sean Whitton




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#71461; Package emacs. (Tue, 11 Jun 2024 15:42:03 GMT) Full text and rfc822 format available.

Message #8 received at 71461 <at> debbugs.gnu.org (full text, mbox):

From: Dmitry Gutov <dmitry <at> gutov.dev>
To: Sean Whitton <spwhitton <at> spwhitton.name>, 71461 <at> debbugs.gnu.org
Cc: juri <at> linkov.net
Subject: Re: bug#71461: 30.0.50; Want VC command to view a single revision
 like a patch
Date: Tue, 11 Jun 2024 00:06:45 +0300
Hi!

On 10/06/2024 11:00, Sean Whitton wrote:
> While resolving conflicts, I often just want to look at a summary of a
> single revision.  I want to see the revision's root diff, and sometimes
> also its log message.
> 
> This isn't very easy with VC at present.  There is
>      C-x v b L <revision> RET =
> and
>      C-u C-x v D <revision>~1 RET <revision> RET
> but neither are very nice (and the latter requires you to specify the
> previous revision using VCS-specific notation).

There is this somewhat clunky sequence: M-1 C-x v L <revision> RET

Does this work for you?

There is description for this subfeature in vc-print-root-log's docstring.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#71461; Package emacs. (Tue, 11 Jun 2024 15:52:04 GMT) Full text and rfc822 format available.

Message #11 received at 71461 <at> debbugs.gnu.org (full text, mbox):

From: Dmitry Gutov <dmitry <at> gutov.dev>
To: Sean Whitton <spwhitton <at> spwhitton.name>
Cc: 71461 <at> debbugs.gnu.org, juri <at> linkov.net
Subject: Re: bug#71461: 30.0.50; Want VC command to view a single revision
 like a patch
Date: Tue, 11 Jun 2024 14:40:03 +0300
On 11/06/2024 08:00, Sean Whitton wrote:
> Oh, great, thanks.  How about this docs change for discoverability?

LGTM!




Reply sent to Sean Whitton <spwhitton <at> spwhitton.name>:
You have taken responsibility. (Fri, 14 Jun 2024 01:07:02 GMT) Full text and rfc822 format available.

Notification sent to Sean Whitton <spwhitton <at> spwhitton.name>:
bug acknowledged by developer. (Fri, 14 Jun 2024 01:07:02 GMT) Full text and rfc822 format available.

Message #16 received at 71461-done <at> debbugs.gnu.org (full text, mbox):

From: Sean Whitton <spwhitton <at> spwhitton.name>
To: Dmitry Gutov <dmitry <at> gutov.dev>
Cc: 71461-done <at> debbugs.gnu.org, juri <at> linkov.net
Subject: Re: bug#71461: 30.0.50; Want VC command to view a single revision
 like a patch
Date: Fri, 14 Jun 2024 09:05:44 +0800
Hello,

On Tue 11 Jun 2024 at 02:40pm +03, Dmitry Gutov wrote:

> On 11/06/2024 08:00, Sean Whitton wrote:
>> Oh, great, thanks.  How about this docs change for discoverability?
>
> LGTM!

Pushed that, thanks.

-- 
Sean Whitton




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 12 Jul 2024 11:24:07 GMT) Full text and rfc822 format available.

This bug report was last modified 346 days ago.

Previous Next


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