Skip to content

Commit ea46d90

Browse files
committed
Merge branch 'mt/sparse-checkout-doc-update'
Doc update. * mt/sparse-checkout-doc-update: completion: add support for sparse-checkout doc: sparse-checkout: mention --cone option
2 parents ff5134b + d031049 commit ea46d90

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

Documentation/git-sparse-checkout.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@ COMMANDS
4141
To avoid interfering with other worktrees, it first enables the
4242
`extensions.worktreeConfig` setting and makes sure to set the
4343
`core.sparseCheckout` setting in the worktree-specific config file.
44+
+
45+
When `--cone` is provided, the `core.sparseCheckoutCone` setting is
46+
also set, allowing for better performance with a limited set of
47+
patterns (see 'CONE PATTERN SET' below).
4448

4549
'set'::
4650
Write a set of patterns to the sparse-checkout file, as given as

contrib/completion/git-completion.bash

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2735,6 +2735,27 @@ _git_show_branch ()
27352735
__git_complete_revlist
27362736
}
27372737

2738+
_git_sparse_checkout ()
2739+
{
2740+
local subcommands="list init set disable"
2741+
local subcommand="$(__git_find_on_cmdline "$subcommands")"
2742+
if [ -z "$subcommand" ]; then
2743+
__gitcomp "$subcommands"
2744+
return
2745+
fi
2746+
2747+
case "$subcommand,$cur" in
2748+
init,--*)
2749+
__gitcomp "--cone"
2750+
;;
2751+
set,--*)
2752+
__gitcomp "--stdin"
2753+
;;
2754+
*)
2755+
;;
2756+
esac
2757+
}
2758+
27382759
_git_stash ()
27392760
{
27402761
local save_opts='--all --keep-index --no-keep-index --quiet --patch --include-untracked'

0 commit comments

Comments
 (0)