As described at [1], the split of init and set subcommands in
sparse-checkout causes multiple issues:
* Poor performance (deleting all tracked files, then later restoring many
and maybe even most of them)
* Poor UI (multiple progress bars in wrappers that hide both commands under
1 user-facing command)
* Loss of ignored files under directories the user wanted to keep
This series fixes this bug by providing a single command to switch to a
sparse-checkout: set. It does so by making set able to do the combined work
of init and set. It keeps init as-is to give folks time to adapt, but marks
it as deprecated.
A quick overview:
* Patches 1-2: small preparatory refactorings
* Patch 3: the crux of the series
* Patches 4-5: documentation modifications (Patch 4 is worth reviewing; it
marks init as deprecated -- are others okay with that?)
* Patch 6: trivial modification of git clone --sparse to use git
sparse-checkout set rather than git sparse-checkout init.
[1]
https://lore.kernel.org/git/CABPp-BE8TJ8QGAQWsSGT7S+9Xp-XmApcC9PSw3K=RQOP0rt+PQ@mail.gmail.com/ (local)
Elijah Newren (6):
sparse-checkout: pass use_stdin as a parameter instead of as a global
sparse-checkout: break apart functions for sparse_checkout_(set|add)
sparse-checkout: enable `set` to initialize sparse-checkout mode
git-sparse-checkout.txt: update to document that set handles init
Documentation: clarify/correct a few sparsity related statements
clone: avoid using deprecated `sparse-checkout init`
Documentation/git-clone.txt | 8 +-
Documentation/git-sparse-checkout.txt | 94 ++++++++++---------
builtin/clone.c | 2 +-
builtin/sparse-checkout.c | 130 +++++++++++++++++++++-----
4 files changed, 160 insertions(+), 74 deletions(-)
base-commit: abe6bb3905392d5eb6b01fa6e54d7e784e0522aa
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-1151%2Fnewren%2Fsparse-checkout-no-init-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-1151/newren/sparse-checkout-no-init-v1
Pull-Request: https://github.com/git/git/pull/1151
--
gitgitgadget