Re: [PATCH 4/6] git-sparse-checkout.txt: update to document that set handles init
flat view
From: Derrick Stolee <hidden>
Date: 2021-12-07 16:45:45
On 12/4/2021 4:48 PM, Victoria Dye wrote:
Elijah Newren via GitGitGadget wrote:
quoted
+'init':: + Deprecated command that behaves like `set` with no specified paths. + May be removed in the future.I'm on board with deprecating `init`, but one usage that's not covered by the updated `set` is toggling the sparse index *without* modifying the patterns. That likely won't matter to most users, but ones that assume `git sparse-checkout set --[no-]sparse-index` works the same way as `git sparse-checkout init --[no-]sparse-index` would find themselves losing their existing pattern set. Maybe `--[no-]sparse-index` should be added to `git sparse-checkout reapply`? For changing settings without updating patterns, that probably makes more sense than `init` or `set` anyway. If adding that option is outside the scope of what you want to do in this series, though, I'd be happy with a note somewhere in this documentation explicitly noting that `set` (unlike `init`) will change your patterns, even when toggling `index.sparse` (or `core.sparseCheckoutCone`).
I like 'reapply' as a good place for that functionality. Hopefully it won't be long before the sparse index is on by default, but it will still be good to have a user-facing way to toggle it, when necessary. Thanks, -Stolee