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.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Sean Whitton <spwhitton <at> spwhitton.name>
Subject: bug#71461: closed (Re: bug#71461: 30.0.50; Want VC command to
 view a single revision like a patch)
Date: Fri, 14 Jun 2024 01:07:02 +0000
[Message part 1 (text/plain, inline)]
Your bug report

#71461: 30.0.50; Want VC command to view a single revision like a patch

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to 71461 <at> debbugs.gnu.org.

-- 
71461: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=71461
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
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

[Message part 3 (message/rfc822, inline)]
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



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.