Subject: Re: [PATCH v5 00/21] Sparse Index: Design, Format, Tests

From: Junio C Hamano <[email-masked]>
Date: Tue, 30 Mar 2021 13:11:30 -0700

"Derrick Stolee via GitGitGadget" <[email-masked]> writes:

>      @@ repo-settings.c: void prepare_repo_settings(struct repository *r)
>       +	 * Initialize this as off.
>       +	 */
>       +	r->settings.sparse_index = 0;
>      -+	if (!repo_config_get_bool(r, "extensions.sparseindex", &value) && value)
>      ++	if (!repo_config_get_bool(r, "index.sparse", &value) && value)
>       +		r->settings.sparse_index = 1;
>        }

It would be helpful to have a way for the repository owner to say
"Even if the version of Git may be capable of handling 'sdir'
extension, and my checkout uses sparse-cone settings, I do not want
to use it", and the other way around, i.e. "Even if my checkout
currently does not use sparse-cone settings, do use 'sdir'
extension".  But for that, .sparse_index member may need to be
tristate (i.e. forbidden, enable-if-needed, use-even-unneeded)?

We have a similar setting in index.version; I believe we always
auto-demote 3 down to 2 when extended flags are not used, and
I think "always auto-demote" would be sufficient (iow,
"use-even-unneeded" may not be necessary, even though that might
help debugging).

Thanks.