Re: [PATCH 4/6] git-sparse-checkout.txt: update to document that set handles init
- From
Derrick Stolee <stolee@gmail.com>
- Date
- Dec 7, 2021, 16:45 UTC
- Message-ID
- <ab6a6e5d-d1a4-4122-5f4e-de4a840af681@gmail.com>
- In-Reply-To
- <9e4e34c9-5485-c10d-48b6-a1a6f5e12486@github.com>
On 12/4/2021 4:48 PM, Victoria Dye wrote:
> Elijah Newren via GitGitGadget wrote:
Show 18 quoted lines
>> +'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