From a402723e488c66bd12cf674c332f185fee1d2347 Mon Sep 17 00:00:00 2001 From: Matheus Tavares Date: Thu, 23 Jan 2020 16:00:02 -0300 Subject: doc: sparse-checkout: mention --cone option In af09ce2 ("sparse-checkout: init and set in cone mode", 2019-11-21), the '--cone' option was added to 'git sparse-checkout init'. Document it. Signed-off-by: Matheus Tavares Acked-by: Derrick Stolee Signed-off-by: Junio C Hamano diff --git a/Documentation/git-sparse-checkout.txt b/Documentation/git-sparse-checkout.txt index 974ade2..e6f235a 100644 --- a/Documentation/git-sparse-checkout.txt +++ b/Documentation/git-sparse-checkout.txt @@ -41,6 +41,10 @@ COMMANDS To avoid interfering with other worktrees, it first enables the `extensions.worktreeConfig` setting and makes sure to set the `core.sparseCheckout` setting in the worktree-specific config file. ++ +When `--cone` is provided, the `core.sparseCheckoutCone` setting is +also set, allowing for better performance with a limited set of +patterns (see 'CONE PATTERN SET' below). 'set':: Write a set of patterns to the sparse-checkout file, as given as -- cgit v0.10.2-6-g49f6 From d031049da356fc345d75c51ec1fbfbeab0f1c8cb Mon Sep 17 00:00:00 2001 From: Matheus Tavares Date: Thu, 23 Jan 2020 16:00:03 -0300 Subject: completion: add support for sparse-checkout Signed-off-by: Matheus Tavares Acked-by: Derrick Stolee Signed-off-by: Junio C Hamano diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash index e4d9ff4..cb1f1b5 100644 --- a/contrib/completion/git-completion.bash +++ b/contrib/completion/git-completion.bash @@ -2718,6 +2718,27 @@ _git_show_branch () __git_complete_revlist } +_git_sparse_checkout () +{ + local subcommands="list init set disable" + local subcommand="$(__git_find_on_cmdline "$subcommands")" + if [ -z "$subcommand" ]; then + __gitcomp "$subcommands" + return + fi + + case "$subcommand,$cur" in + init,--*) + __gitcomp "--cone" + ;; + set,--*) + __gitcomp "--stdin" + ;; + *) + ;; + esac +} + _git_stash () { local save_opts='--all --keep-index --no-keep-index --quiet --patch --include-untracked' -- cgit v0.10.2-6-g49f6