Skip to content

Commit 4783edb

Browse files
jeffhostetlermjcheetham
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 e76967d commit 4783edb

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

t/t1093-virtualfilesystem.sh

+2
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

+9-4
Original file line numberDiff line numberDiff line change
@@ -1622,10 +1622,15 @@ static void show_sparse_checkout_in_use(struct wt_status *s,
16221622
{
16231623
if (s->state.sparse_checkout_percentage == SPARSE_CHECKOUT_DISABLED)
16241624
return;
1625-
if (core_virtualfilesystem)
1626-
return;
1627-
1628-
if (s->state.sparse_checkout_percentage == SPARSE_CHECKOUT_SPARSE_INDEX)
1625+
if (core_virtualfilesystem) {
1626+
if (s->state.sparse_checkout_percentage == SPARSE_CHECKOUT_SPARSE_INDEX)
1627+
status_printf_ln(s, color,
1628+
_("You are in a partially-hydrated checkout with a sparse index."));
1629+
else
1630+
status_printf_ln(s, color,
1631+
_("You are in a partially-hydrated checkout with %d%% of tracked files present."),
1632+
s->state.sparse_checkout_percentage);
1633+
} else if (s->state.sparse_checkout_percentage == SPARSE_CHECKOUT_SPARSE_INDEX)
16291634
status_printf_ln(s, color, _("You are in a sparse checkout."));
16301635
else
16311636
status_printf_ln(s, color,

0 commit comments

Comments
 (0)