mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-01 12:17:25 -05:00
fix(magit): do less on magit-refresh-buffer
Inhibit recentf-cleanup and projectile caching, and silence it's logging on refresh-buffer. The former can potentially be slow and isn't necessary on top of invalidating the cache, and the latter is noise.
This commit is contained in:
@ -71,12 +71,18 @@ FUNCTION
|
||||
;; Turn ref links into clickable buttons.
|
||||
(add-hook 'magit-process-mode-hook #'goto-address-mode)
|
||||
|
||||
;; Since the project likely now contains new files, best we undo the
|
||||
;; projectile cache so it can be regenerated later.
|
||||
;; Since the project likely now contains new files, purge the projectile cache
|
||||
;; so `projectile-find-file' et all don't produce an stale file list.
|
||||
(add-hook! 'magit-refresh-buffer-hook
|
||||
(defun +magit-invalidate-projectile-cache-h ()
|
||||
(let (projectile-require-project-root)
|
||||
(projectile-invalidate-cache nil))))
|
||||
;; Only invalidate the hot cache and nothing else (everything else is
|
||||
;; expensive busy work, and we don't want to slow down magit's
|
||||
;; refreshing).
|
||||
(let (projectile-require-project-root
|
||||
projectile-enable-caching
|
||||
projectile-verbose)
|
||||
(letf! ((#'recentf-cleanup #'ignore))
|
||||
(projectile-invalidate-cache nil)))))
|
||||
;; Use a more efficient strategy to auto-revert buffers whose git state has
|
||||
;; changed: refresh the visible buffers immediately...
|
||||
(add-hook 'magit-post-refresh-hook #'+magit-mark-stale-buffers-h)
|
||||
|
Reference in New Issue
Block a user