GNU bug report logs - #38044
27.0.50; There should be an easier way to look at a specific vc commit

Previous Next

Package: emacs;

Reported by: Lars Ingebrigtsen <larsi <at> gnus.org>

Date: Sun, 3 Nov 2019 15:18:03 UTC

Severity: wishlist

Tags: fixed

Found in version 27.0.50

Fixed in version 27.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Stephen Berman <stephen.berman <at> gmx.net>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: larsi <at> gnus.org, dgutov <at> yandex.ru, 38044 <at> debbugs.gnu.org, juri <at> linkov.net
Subject: bug#38044: 27.0.50; There should be an easier way to look at a specific vc commit
Date: Sun, 01 Dec 2019 14:13:06 +0100
[Message part 1 (text/plain, inline)]
On Fri, 22 Nov 2019 09:24:41 +0200 Eli Zaretskii <eliz <at> gnu.org> wrote:

>> From: Stephen Berman <stephen.berman <at> gmx.net>
>> Cc: Dmitry Gutov <dgutov <at> yandex.ru>,  juri <at> linkov.net,  larsi <at> gnus.org,
>>   38044 <at> debbugs.gnu.org
>> Date: Thu, 21 Nov 2019 22:15:21 +0100
[...]
>> Since one of the desiderata of this command, perhaps even the main
>> one, is that it should act on the revision ID at point, how about
>> making just `C-x v L' do that if it recognizes the word at point as
>> a revision ID?
>
> We could do that, yes.

I haven't found a useful way to do this.

>> If this is deemed to unreliable, it could be conditioned by a user
>> option, or perhaps (though more annoying) by asking for
>> confirmation.
>
> Fine with me, assuming the rest of the proposal is accepted.

On reflection, both of these alternatives don't seem convenient enough
to justify them.

There is, however, another option that is convenient (at least to me)
and easy to implement.  Most of the time of I want to look up the log
entry and/or diff of the revision ID at point the current buffer is not
a version-controlled buffer (typically it's a Gnus buffer), so the
default directory is wrong and I have to manually change to the
version-controlled root directory.  For me this is almost always the
Emacs master branch, so it would be convenient if typing `C-1 C-x v L'
offered this directory as a default, as a user option.  The patch below
does this.

The way vc-print-root-log sets the root directory is also done exactly
the same by vc-root-version-diff, vc-diff-mergebase, vc-root-diff and
vc-log-mergebase, so perhaps these commands should also be changed to
offer a user-specified default.  I haven't used any of these yet, so I
don't know if this is as convenient for them as it is for
vc-print-root-log.

Steve Berman

[Message part 2 (text/x-patch, inline)]
diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el
index d0d2c39ac3..06a3e90837 100644
--- a/lisp/vc/vc.el
+++ b/lisp/vc/vc.el
@@ -848,6 +848,14 @@ vc-revert-show-diff
   :type 'boolean
   :version "24.1")

+(defcustom vc-default-root-dir nil
+  "User-specified root directory for VC operations.
+Offered as default when the VC backend fails to identify a root
+directory."
+  :type '(choice (const :tag "None" nil)
+                 (file :must-match t :tag "File"))
+  :version "27.1")
+
 ;; Header-insertion hair

 (defcustom vc-static-header-alist
@@ -2517,7 +2525,8 @@ vc-print-root-log
 	 rootdir)
     (if backend
 	(setq rootdir (vc-call-backend backend 'root default-directory))
-      (setq rootdir (read-directory-name "Directory for VC root-log: "))
+      (setq rootdir (read-directory-name "Directory for VC root-log: "
+                                         vc-default-root-dir))
       (setq backend (vc-responsible-backend rootdir))
       (unless backend
         (error "Directory is not version controlled")))

This bug report was last modified 4 years and 355 days ago.

Previous Next


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