Re: 2.34 regression (and workaround): deleting untracked files both outside *and inside* desired sparsity cone
- From
Derrick Stolee <stolee@gmail.com>
- Date
- Dec 2, 2021, 00:41 UTC
- Message-ID
- <d981adbf-7f6a-32f8-2d3e-8af5c36a6f8f@gmail.com>
- In-Reply-To
- <CABPp-BHSPQMUw8a6E7Kz+7L6NuD8c9GrHdTMf_rBzQR+2VGs-Q@mail.gmail.com>
On 12/1/2021 6:40 PM, Elijah Newren wrote:
Show 9 quoted lines
> On Wed, Dec 1, 2021 at 11:19 AM Derrick Stolee <stolee@gmail.com> wrote: >> >> We would want to be careful now that >> "--option" could be interpreted as a path to recommend using >> >> git sparse-checkout set <options> -- <path1> ... <pathN> > > Makes sense. However, wasn't this already an issue when you added > `--stdin` as an option for the `set` command?
You are right. This should already be handled in a sane way.
Show 14 quoted lines
>> While you are here, I would be interested in making 'git clone >> --sparse' default to cone mode. Or, should it be 'git clone >> --sparse=cone' or something? Not making it default to cone mode >> is a big regret of mine. > > I agree it'd be much nicer to have it default to cone mode, and the > big warning in git-sparse-checkout.txt might permit us to do so. A > few related questions: > > * Should we document how to change from cone mode to non-cone mode? > We have --sparse-index, --no-sparse-index, and --cone flags, but no > --no-cone one. Should we? (Do these flags belong somewhere other > than `init` since it's toggling some other flag while already using a > sparse-checkout?)
--no-cone exists, it probably just isn't in the docs. Our 'init' options are defined as follows:
static struct option builtin_sparse_checkout_init_options[] = {
OPT_BOOL(0, "cone", &init_opts.cone_mode,
N_("initialize the sparse-checkout in cone mode")),
OPT_BOOL(0, "sparse-index", &init_opts.sparse_index,
N_("toggle the use of a sparse index")),
OPT_END(),
};so --no-cone exists the same way --no-sparse-index does.
Show 12 quoted lines
> * Should we clean up the wording in clone's --sparse option? In particular: > > --sparse:: > Initialize the sparse-checkout file so the working > directory starts with only the files in the root > of the repository. The sparse-checkout file can be > modified to grow the working directory as needed. > > This wording seems to suggest direct editing of > .git/info/sparse-checkout, and might confuse users. Perhaps the last > sentence could change "sparse-checkout file can be modified" -> > "sparse-checkout command can be used" or something like that?
This is probably just too old. It could use updates to link to git-sparse-checkout.
Thanks, -Stolee