sparse-checkout: add completion and --cone to docs
cover sparse-checkout: add completion and --cone to docs
This adds completion for the sparse-checkout command and mention the init's --cone option in the doc file. I know this command might change in the near future, so I'm not sure whether these changes are worth right now; but since they were simple to do, I decided to send them and ask for your comments.
travis build: https://travis-ci.org/matheustavares/git/builds/641012914
Matheus Tavares (2):
doc: sparse-checkout: mention --cone option
completion: add support for sparse-checkout
Documentation/git-sparse-checkout.txt | 4 ++++ contrib/completion/git-completion.bash | 21 +++++++++++++++++++++ 2 files changed, 25 insertions(+)
Signature · 1 line
2.25.0
PATCH 1/2 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'. Add this option to the respective doc file.
--- Documentation/git-sparse-checkout.txt | 4 ++++ 1 file changed, 4 insertions(+)
Documentation/git-sparse-checkout.txt +4 -0
@@ -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' bellow). 'set':: Write a set of patterns to the sparse-checkout file, as given as
Signature · 1 line
2.25.0
Re: [PATCH 1/2] doc: sparse-checkout: mention --cone option
Hi Matheus,
Quoted 3 lines · Matheus Tavares
In af09ce2 ("sparse-checkout: init and set in cone mode", 2019-11-21), the '--cone' option was added to 'git sparse-checkout init'. Add this option to the respective doc file.
Nit: s/respective/corresponding/
"Respective" sounds -- to me at least -- like you're tweaking two different files. Maybe that's just me.
Quoted 5 lines
To avoid interfering with other worktrees, it first enables the
extensions.worktreeConfigsetting and makes sure to set thecore.sparseCheckoutsetting in the worktree-specific config file.
++
+When--coneis provided thecore.sparseCheckoutConesetting is also
Nit: maybe add a comma after "provided". Without it, I could see someone false-starting the parsing as "provided with the" or even "provided to the". Those readings obviously don't work out in the end, but with an extra comma, I think it's easier to just naturally read this the way it's intended.
Documentation/git-sparse-checkout.txt COMMANDS · line 47
Quoted 2 lines
Documentation/git-sparse-checkout.txt +2
-0+set, allowing for better performance with a limited set of patterns +(see 'CONE PATTERN SET' bellow).
s/bellow/below/
Martin
Re: [PATCH 1/2] doc: sparse-checkout: mention --cone option
Hi, Martin
Quoted 25 lines · Martin Ågren
Hi Matheus,
Quoted 3 lines · Matheus Tavares
In af09ce2 ("sparse-checkout: init and set in cone mode", 2019-11-21), the '--cone' option was added to 'git sparse-checkout init'. Add this option to the respective doc file.
Nit: s/respective/corresponding/
"Respective" sounds -- to me at least -- like you're tweaking two different files. Maybe that's just me.
Quoted 5 lines
To avoid interfering with other worktrees, it first enables the
extensions.worktreeConfigsetting and makes sure to set thecore.sparseCheckoutsetting in the worktree-specific config file.
++
+When--coneis provided thecore.sparseCheckoutConesetting is alsoNit: maybe add a comma after "provided". Without it, I could see someone false-starting the parsing as "provided with the" or even "provided to the". Those readings obviously don't work out in the end, but with an extra comma, I think it's easier to just naturally read this the way it's intended.
Quoted 4 lines
Documentation/git-sparse-checkout.txt COMMANDS · line 47
Quoted 2 lines
Documentation/git-sparse-checkout.txt +2
-0+set, allowing for better performance with a limited set of patterns +(see 'CONE PATTERN SET' bellow).s/bellow/below/
Thanks for the comments. Junio has already addressed them[1] when picking up the patch :)
[1]: https://github.com/gitster/git/commit/a402723e488c66bd12cf674c332f185fee1d2347
PATCH 2/2 completion: add support for sparse-checkout
In reply to Matheus Tavares--- contrib/completion/git-completion.bash | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+)
contrib/completion/git-completion.bash +21 -0
@@ -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'
Signature · 1 line
2.25.0
Quoted 11 lines · Matheus Tavares
This adds completion for the sparse-checkout command and mention the init's --cone option in the doc file. I know this command might change in the near future, so I'm not sure whether these changes are worth right now; but since they were simple to do, I decided to send them and ask for your comments.
travis build: https://travis-ci.org/matheustavares/git/builds/641012914
Matheus Tavares (2):
doc: sparse-checkout: mention --cone option
completion: add support for sparse-checkout
Thanks for catching these. They are both good patches.
-Stolee