emacs-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#71461: closed (30.0.50; Want VC command to view a single revision li


From: GNU bug Tracking System
Subject: bug#71461: closed (30.0.50; Want VC command to view a single revision like a patch)
Date: Fri, 14 Jun 2024 01:07:02 +0000

Your message dated Fri, 14 Jun 2024 09:05:44 +0800
with message-id <874j9wfi53.fsf@melete.silentflame.com>
and subject line Re: bug#71461: 30.0.50; Want VC command to view a single 
revision like a patch
has caused the debbugs.gnu.org bug report #71461,
regarding 30.0.50; Want VC command to view a single revision like a patch
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs@gnu.org.)


-- 
71461: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=71461
GNU Bug Tracking System
Contact help-debbugs@gnu.org with problems
--- Begin Message --- Subject: 30.0.50; Want VC command to view a single revision like a patch Date: Mon, 10 Jun 2024 16:00:44 +0800 User-agent: Gnus/5.13 (Gnus v5.13)
X-debbugs-cc: juri@linkov.net, dmitry@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



--- End Message ---
--- Begin Message --- 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 User-agent: Gnus/5.13 (Gnus v5.13)
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


--- End Message ---

reply via email to

[Prev in Thread] Current Thread [Next in Thread]