* lisp/vc/vc-dir.el (vc-dir-hide-up-to-date-on-revert):
New defcustom.
(vc-dir-revert-buffer-function): Use it.
* etc/NEWS: Document it.
(cherry picked from commit
f9b311464db2e1cc34faaf2c86a9c46216337013)
:group 'vc
:version "31.1")
+(defcustom vc-dir-hide-up-to-date-on-revert nil
+ "If non-nil, \\<vc-dir-mode-map>\\[revert-buffer] in VC-Dir buffers also does \\[vc-dir-hide-up-to-date].
+That is, refreshing the VC-Dir buffer also hides `up-to-date' and
+`ignored' items."
+ :type 'boolean
+ :group 'vc
+ :version "31.1")
+
(defun vc-dir-move-to-goal-column ()
;; Used to keep the cursor on the file name column.
(beginning-of-line)
(not (vc-dir-fileinfo->needs-update info))))))))))))
(defun vc-dir-revert-buffer-function (&optional _ignore-auto _noconfirm)
- (vc-dir-refresh))
+ (vc-dir-refresh)
+ (when vc-dir-hide-up-to-date-on-revert
+ (vc-dir-hide-state)))
(defun vc-dir-refresh ()
"Refresh the contents of the *VC-dir* buffer.