Skip to content

Commit 9995935

Browse files
jeffhostetlerdscho
authored andcommitted
wt-status: add VFS hydration percentage to normal git status output
Add VFS checkout hydration percentage information to the default `git status` output. When VFS is enable, users will now see a "You are in a partially-hydrated checkout with <percentage> of tracked files present." message. Upstream `git status` normally prints a "You are in a sparse checkout with <percentage> of tracked files present." This message was hidden in `microsoft/git` when `core_virtualfilesystem` is set (because GVFS users are always (and secretly) in a sparse checkout) and it was thought that it would annoy users. However, we now believe that it may be helpful for users to always see the percentage and know when they are over-hyrdated, since over-hyrdation can occur by accident and may greatly impact their Git performance. Knowing this value may help with GVFS support. Helped-by: Johannes Schindelin <[email protected]> Signed-off-by: Jeff Hostetler <[email protected]>
1 parent ba33c06 commit 9995935

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

t/t1093-virtualfilesystem.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@ test_expect_success 'verify status is clean' '
6969
git status > actual &&
7070
cat > expected <<-\EOF &&
7171
On branch main
72+
You are in a partially-hydrated checkout with 75% of tracked files present.
73+
7274
nothing to commit, working tree clean
7375
EOF
7476
test_cmp expected actual

wt-status.c

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1606,10 +1606,15 @@ static void show_sparse_checkout_in_use(struct wt_status *s,
16061606
{
16071607
if (s->state.sparse_checkout_percentage == SPARSE_CHECKOUT_DISABLED)
16081608
return;
1609-
if (core_virtualfilesystem)
1610-
return;
1611-
1612-
if (s->state.sparse_checkout_percentage == SPARSE_CHECKOUT_SPARSE_INDEX)
1609+
if (core_virtualfilesystem) {
1610+
if (s->state.sparse_checkout_percentage == SPARSE_CHECKOUT_SPARSE_INDEX)
1611+
status_printf_ln(s, color,
1612+
_("You are in a partially-hydrated checkout with a sparse index."));
1613+
else
1614+
status_printf_ln(s, color,
1615+
_("You are in a partially-hydrated checkout with %d%% of tracked files present."),
1616+
s->state.sparse_checkout_percentage);
1617+
} else if (s->state.sparse_checkout_percentage == SPARSE_CHECKOUT_SPARSE_INDEX)
16131618
status_printf_ln(s, color, _("You are in a sparse checkout."));
16141619
else
16151620
status_printf_ln(s, color,

0 commit comments

Comments
 (0)