[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/git-commit 18728adc76 4/9: magit-zap-caches: With a prefix
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/git-commit 18728adc76 4/9: magit-zap-caches: With a prefix discard complete caches |
Date: |
Tue, 22 Feb 2022 05:58:10 -0500 (EST) |
branch: elpa/git-commit
commit 18728adc7610e56419321a53ff9011d8d928a8c8
Author: Jonas Bernoulli <jonas@bernoul.li>
Commit: Jonas Bernoulli <jonas@bernoul.li>
magit-zap-caches: With a prefix discard complete caches
---
lisp/magit-mode.el | 31 +++++++++++++++++++++----------
1 file changed, 21 insertions(+), 10 deletions(-)
diff --git a/lisp/magit-mode.el b/lisp/magit-mode.el
index 95d4898a1e..5d8764c59a 100644
--- a/lisp/magit-mode.el
+++ b/lisp/magit-mode.el
@@ -1421,20 +1421,31 @@ Unless specified, REPOSITORY is the current buffer's
repository."
(magit-repository-local-get
(cons mode 'magit-section-visibility-cache))))
-(defun magit-zap-caches ()
+(defun magit-zap-caches (&optional all)
"Zap caches for the current repository.
+
Remove the repository's entry from `magit-repository-local-cache'
and set `magit-section-visibility-cache' to nil in all of the
-repository's Magit buffers."
+repository's Magit buffers.
+
+With a prefix argument or if optional ALL is non-nil, discard the
+mentioned caches completely."
(interactive)
- (magit-with-toplevel
- (setq magit-repository-local-cache
- (cl-delete default-directory
- magit-repository-local-cache
- :key #'car :test #'equal)))
- (dolist (buffer (magit-mode-get-buffers))
- (with-current-buffer buffer
- (setq magit-section-visibility-cache nil)))
+ (cond (all
+ (setq magit-repository-local-cache nil)
+ (dolist (buffer (buffer-list))
+ (with-current-buffer buffer
+ (when (derived-mode-p 'magit-mode)
+ (setq magit-section-visibility-cache nil)))))
+ (t
+ (magit-with-toplevel
+ (setq magit-repository-local-cache
+ (cl-delete default-directory
+ magit-repository-local-cache
+ :key #'car :test #'equal)))
+ (dolist (buffer (magit-mode-get-buffers))
+ (with-current-buffer buffer
+ (setq magit-section-visibility-cache nil)))))
(setq magit--libgit-available-p 'unknown))
;;; Utilities
- [nongnu] elpa/git-commit updated (68be0584f4 -> 9b94654921), ELPA Syncer, 2022/02/22
- [nongnu] elpa/git-commit 4d59e1cafd 5/9: magit-zap-caches: Also zap magit--remotes-using-recent-git, ELPA Syncer, 2022/02/22
- [nongnu] elpa/git-commit 8394f0d4ea 8/9: Refactor git version asserts, ELPA Syncer, 2022/02/22
- [nongnu] elpa/git-commit 477603835b 6/9: magit-debug-git-executable: Move definition to magit-git.el, ELPA Syncer, 2022/02/22
- [nongnu] elpa/git-commit 69be963b62 2/9: magit-startup-asserts: Remove special case for Travis, ELPA Syncer, 2022/02/22
- [nongnu] elpa/git-commit 489f84a3d6 7/9: magit--safe-git-version: New function, ELPA Syncer, 2022/02/22
- [nongnu] elpa/git-commit 6c4ff54a08 3/9: magit-startup-asserts: Don't check Git version when building Magit, ELPA Syncer, 2022/02/22
- [nongnu] elpa/git-commit 9b94654921 9/9: Remove redundant version/feature caches, ELPA Syncer, 2022/02/22
- [nongnu] elpa/git-commit 18728adc76 4/9: magit-zap-caches: With a prefix discard complete caches,
ELPA Syncer <=
- [nongnu] elpa/git-commit d5ed87b138 1/9: magit-margin-default-time-format: New un-advertised variable, ELPA Syncer, 2022/02/22