New user option vc-dir-show-outgoing-count

* lisp/vc/vc-dir.el (vc-dir-show-outgoing-count): New defcustom.
(vc-dir-headers): Use it.
* doc/emacs/maintaining.texi (VC Directory Buffer):
* etc/NEWS: Document it.
This commit is contained in:
Sean Whitton 2025-12-06 16:24:59 +00:00
parent 39f34f6470
commit 1bdf9dd6cd
3 changed files with 25 additions and 1 deletions

View file

@ -1528,6 +1528,17 @@ unpushed revisions"} where @var{N} is a number. You can click on this
text to execute the @code{vc-log-outgoing} command (@pxref{VC Change
Log}).
@vindex vc-dir-show-outgoing-count
Emacs tries to use cached information to determine the number of
unpushed revisions, but for some backends this isn't possible. In these
cases Emacs must occasionally fetch from the remote repository in order
to determine the count. If your connection to the remote repository is
slow then this may cause unacceptable slowdowns in refreshing the VC
Directory buffer. If this affects you, you can customize
@code{vc-dir-show-outgoing-count} to nil to disable the unpushed
revisions count altogether. You can also set this on a per-repository
basis using directory local variables (@pxref{Directory Variables}).
@node VC Directory Commands
@subsubsection VC Directory Commands

View file

@ -2551,6 +2551,7 @@ bindings:
*** New display of outgoing revisions count in VC Directory.
If there are outgoing revisions, VC Directory now includes a count of
how many in its headers, to remind you to push them.
You can disable this by customizing vc-dir-show-outgoing-count to nil.
+++
*** New user option 'vc-async-checkin' to enable async checkin operations.

View file

@ -1339,6 +1339,17 @@ the *vc-dir* buffer.
:doc "Local keymap for viewing outgoing revisions."
"<down-mouse-1>" #'vc-log-outgoing)
(defcustom vc-dir-show-outgoing-count t
"Whether to display the number of unpushed revisions in VC-Dir.
For some combinations of VC backends and remotes, determining how many
outgoing revisions there are is slow, because the backend must fetch
from the remote, and your connection to the remote is slow. Customize
this variable to nil to disable calculating the outgoing count and
therefore also disable the fetching."
:type 'boolean
:group 'vc
:version "31.1")
(defun vc-dir-headers (backend dir)
"Display the headers in the *VC-Dir* buffer.
It calls the `dir-extra-headers' backend method to display backend
@ -1351,7 +1362,8 @@ specific headers."
'face 'vc-dir-header-value)
(vc-call-backend backend 'dir-extra-headers dir)
"\n"
(and-let* ((count (ignore-errors (vc--count-outgoing backend)))
(and-let* (vc-dir-show-outgoing-count
(count (ignore-errors (vc--count-outgoing backend)))
(_ (plusp count)))
(concat (propertize "Outgoing : "
'face 'vc-dir-header)