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")))