[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/git-commit ae3770306d 3/7: magit-sparse-checkout: Add --sp
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/git-commit ae3770306d 3/7: magit-sparse-checkout: Add --sparse-index |
Date: |
Sun, 23 Jan 2022 16:58:07 -0500 (EST) |
branch: elpa/git-commit
commit ae3770306d091f45bf8a9183494bc42540cc4d70
Author: Kyle Meyer <kyle@kyleam.com>
Commit: Kyle Meyer <kyle@kyleam.com>
magit-sparse-checkout: Add --sparse-index
If `git sparse-checkout init' is called with --sparse-index, the index
is written with sparse directory entries.
Note that the user can also get this behavior by configuring
index.sparse to true, in which case --no-sparse-index would be the
useful argument to have in the transient so that the caller could
override their configured value for a particular call.
However, leave off --no-sparse-index, at least for now. There are
other examples of --x/--no-x options along with an associated config
knob (e.g., --recurse-submodules in magit-branch) that we don't bother
supporting (in terms of having both options available in the transient
or considering the configured value).
---
lisp/magit-sparse-checkout.el | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/lisp/magit-sparse-checkout.el b/lisp/magit-sparse-checkout.el
index fea2743d43..f029756f54 100644
--- a/lisp/magit-sparse-checkout.el
+++ b/lisp/magit-sparse-checkout.el
@@ -76,6 +76,9 @@ See the `git sparse-checkout' manpage for details about
(transient-define-prefix magit-sparse-checkout ()
"Create and manage sparse checkouts."
:man-page "git-sparse-checkout"
+ ["Arguments for enabling"
+ :if-not magit-sparse-checkout-enabled-p
+ ("-i" "Use sparse index" "--sparse-index")]
["Actions"
[:if-not magit-sparse-checkout-enabled-p
("e" "Enable sparse checkout" magit-sparse-checkout-enable)]
@@ -86,11 +89,11 @@ See the `git sparse-checkout' manpage for details about
("a" "Add directories" magit-sparse-checkout-add)]])
;;;###autoload
-(defun magit-sparse-checkout-enable ()
+(defun magit-sparse-checkout-enable (&optional args)
"Convert the working tree to a sparse checkout."
- (interactive)
+ (interactive (list (transient-args 'magit-sparse-checkout)))
(magit-sparse-checkout--assert-version)
- (magit-run-git-async "sparse-checkout" "init" "--cone"))
+ (magit-run-git-async "sparse-checkout" "init" "--cone" args))
;;;###autoload
(defun magit-sparse-checkout-set (directories)
- [nongnu] elpa/git-commit updated (ed7a4b24a2 -> 2a6b51b7f1), ELPA Syncer, 2022/01/23
- [nongnu] elpa/git-commit d1a3c60a9e 4/7: sparse-checkout: Add insert-header function, ELPA Syncer, 2022/01/23
- [nongnu] elpa/git-commit f8f938352d 5/7: magit-clone-sparse: New command, ELPA Syncer, 2022/01/23
- [nongnu] elpa/git-commit c7fd760d99 1/7: magit-revision-directories: New function, ELPA Syncer, 2022/01/23
- [nongnu] elpa/git-commit ae3770306d 3/7: magit-sparse-checkout: Add --sparse-index,
ELPA Syncer <=
- [nongnu] elpa/git-commit 2a6b51b7f1 7/7: manual: Regenerate, ELPA Syncer, 2022/01/23
- [nongnu] elpa/git-commit eb56b14bcb 6/7: magit-clone: Add --filter to support partial clones, ELPA Syncer, 2022/01/23
- [nongnu] elpa/git-commit 2d94a9b363 2/7: Add interface to 'git sparse-checkout', ELPA Syncer, 2022/01/23