Function: diff-hl-reset-reference-rev

diff-hl-reset-reference-rev is an interactive and natively compiled function defined in diff-hl.el.

Signature

(diff-hl-reset-reference-rev &optional ARG)

Documentation

Reset the reference revision globally to the most recent one.

When called with a prefix argument, do the same and discard every per-project reference created by diff-hl-set-reference-rev-in-project.

Key Bindings

This command is not in any keymaps.

Source Code

;; Defined in /nix/store/cfz56rl3lp066226i0bmmgiicls3gcq7-emacs-packages-deps/share/emacs/site-lisp/elpa/diff-hl-20261001.135/diff-hl.el
;;;###autoload
(defun diff-hl-reset-reference-rev (&optional arg)
  "Reset the reference revision globally to the most recent one.

When called with a prefix argument, do the same and discard every
per-project reference created by `diff-hl-set-reference-rev-in-project'."
  (interactive "P")
  (setq-default diff-hl-reference-revision nil)
  (when arg
    ;; reset all cache
    (setq diff-hl-reference-revision-projects-cache nil))
  (dolist (buf (buffer-list))
    (with-current-buffer buf
      (when diff-hl-mode
        (when arg
          ;; reset value in buffers
          (kill-local-variable 'diff-hl-reference-revision))
        (when (bound-and-true-p diff-hl-amend-mode)
          (diff-hl-amend-mode -1))
        ;; Don't touch buffers with the local reference (set by
        ;; `diff-hl-set-reference-rev-in-project' ), when called without a
        ;; prefix.
        (unless (local-variable-p 'diff-hl-reference-revision)
          (diff-hl-update)))))
  (message "Reference revision reset globally to the most recent revision"))