Re: [PATCH v4 1/4] sparse index: enable only for git repos

2 messages, 2 authors, 2021-11-30 · open the first message on its own page

Re: [PATCH v4 1/4] sparse index: enable only for git repos

From: Junio C Hamano <hidden>
Date: 2021-11-30 06:32:46

Lessley Dennington [off-list ref] writes:
This is cool! I applied it locally, and it seems to be working well. I
will plan to replace my changes to checkout and pack-objects with this
for v5.
I didn't write it to replace the changes you were preparing, though.

What the patch is meant to solve is that "git checkout -h" in a
repository, whose .git/config has some custom configuration
variables that affect how the short help text is shown, were
ignoring that per-repository settings by not even checking if we are
in a repository at all.

When "-h" is in effect, and if you are outside a repository, this
would cause the setup_git_directory_gently() function to be called,
and we'd reach checkout_main() without having discovered repository.
I do not think it removes the need for your "only when startup-info
says we have repository, do these" safety.  At least, I didn't write
the patch to remove that need.

Re: [PATCH v4 1/4] sparse index: enable only for git repos

From: Lessley Dennington <hidden>
Date: 2021-11-30 23:27:55


On 11/29/21 10:32 PM, Junio C Hamano wrote:
Lessley Dennington [off-list ref] writes:
quoted
This is cool! I applied it locally, and it seems to be working well. I
will plan to replace my changes to checkout and pack-objects with this
for v5.
I didn't write it to replace the changes you were preparing, though.

What the patch is meant to solve is that "git checkout -h" in a
repository, whose .git/config has some custom configuration
variables that affect how the short help text is shown, were
ignoring that per-repository settings by not even checking if we are
in a repository at all.

When "-h" is in effect, and if you are outside a repository, this
would cause the setup_git_directory_gently() function to be called,
and we'd reach checkout_main() without having discovered repository.
I do not think it removes the need for your "only when startup-info
says we have repository, do these" safety.  At least, I didn't write
the patch to remove that need.
To be clear, I am not replacing the change in repo-settings.c to BUG
if we're trying to prepare settings for an uninitialized repository.
I just removed the conditional I had added around the
prepare_repo_settings method in checkout and pack-objects, since the
failing tests for those builtins started passing with the application
of this patch.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help