[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/git-commit 9b94654921 9/9: Remove redundant version/featur
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/git-commit 9b94654921 9/9: Remove redundant version/feature caches |
Date: |
Tue, 22 Feb 2022 05:58:10 -0500 (EST) |
branch: elpa/git-commit
commit 9b94654921d511ff80d48122481cde02828492db
Author: Jonas Bernoulli <jonas@bernoul.li>
Commit: Jonas Bernoulli <jonas@bernoul.li>
Remove redundant version/feature caches
Functions that compare the Git version on the current host with the
required version use `magit-git-version', which caches the used
version per host.
The result of comparing two versions is not cached, which increases
the cost slightly because they have to be converted to the internal
list format before comparison can happen. `magit-git-version' uses
the refresh cache, making the effect negligible.
---
lisp/magit-diff.el | 10 ++--------
lisp/magit-wip.el | 9 +--------
2 files changed, 3 insertions(+), 16 deletions(-)
diff --git a/lisp/magit-diff.el b/lisp/magit-diff.el
index 96b32f708f..dcff92c65d 100644
--- a/lisp/magit-diff.el
+++ b/lisp/magit-diff.el
@@ -2053,15 +2053,9 @@ Staging and applying changes is documented in info node
(remove "--literal-pathspecs" magit-git-global-arguments)))
;; As of Git 2.19.0, we need to generate diffs with
;; --ita-visible-in-index so that `magit-stage' can work with
- ;; intent-to-add files (see #4026). Cache the result for each
- ;; repo to avoid a `git version' call for every diff insertion.
+ ;; intent-to-add files (see #4026).
(when (and (not (equal cmd "merge-tree"))
- (pcase (magit-repository-local-get 'diff-ita-kludge-p 'unset)
- (`unset
- (let ((val (magit-git-version>= "2.19.0")))
- (magit-repository-local-set 'diff-ita-kludge-p val)
- val))
- (val val)))
+ (magit-git-version>= "2.19.0"))
(push "--ita-visible-in-index" args))
(setq args (magit-diff--maybe-add-stat-arguments args))
(when (cl-member-if (lambda (arg) (string-prefix-p "--color-moved" arg))
args)
diff --git a/lisp/magit-wip.el b/lisp/magit-wip.el
index 7f42b573d7..d5c8072b8d 100644
--- a/lisp/magit-wip.el
+++ b/lisp/magit-wip.el
@@ -301,14 +301,7 @@ commit message."
;; deleted in the temporary index.
(magit-call-git
"update-index" "--add" "--remove"
- (and (pcase (magit-repository-local-get
- 'update-index-has-ignore-sw-p 'unset)
- (`unset
- (let ((val (magit-git-version>= "2.25.0")))
- (magit-repository-local-set
- 'update-index-has-ignore-sw-p val)
- val))
- (val val))
+ (and (magit-git-version>= "2.25.0")
"--ignore-skip-worktree-entries")
"--" files)
(magit-with-toplevel
- [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 <=
- [nongnu] elpa/git-commit 18728adc76 4/9: magit-zap-caches: With a prefix discard complete caches, ELPA Syncer, 2022/02/22
- [nongnu] elpa/git-commit d5ed87b138 1/9: magit-margin-default-time-format: New un-advertised variable, ELPA Syncer, 2022/02/22