From 051df3cfe8ed7d113197636f860edea14f283037 Mon Sep 17 00:00:00 2001 From: Elijah Newren Date: Thu, 18 Jun 2020 20:49:57 +0000 Subject: wt-status: show sparse checkout status as well Some of the early feedback of folks trying out sparse-checkouts at $dayjob is that sparse checkouts can sometimes be disorienting; users can forget that they had a sparse-checkout and then wonder where files went. Add some output to 'git status' in the form of a simple line that states: You are in a sparse checkout with 35% of files present. where, obviously, the exact figure changes depending on what percentage of files from the index do not have the SKIP_WORKTREE bit set. Signed-off-by: Elijah Newren Signed-off-by: Junio C Hamano --- wt-status.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'wt-status.h') diff --git a/wt-status.h b/wt-status.h index 73ab5d4da1..f1fa0ec1a7 100644 --- a/wt-status.h +++ b/wt-status.h @@ -79,6 +79,7 @@ enum wt_status_format { #define HEAD_DETACHED_AT _("HEAD detached at ") #define HEAD_DETACHED_FROM _("HEAD detached from ") +#define SPARSE_CHECKOUT_DISABLED -1 struct wt_status_state { int merge_in_progress; @@ -90,6 +91,7 @@ struct wt_status_state { int bisect_in_progress; int revert_in_progress; int detached_at; + int sparse_checkout_percentage; /* SPARSE_CHECKOUT_DISABLED if not sparse */ char *branch; char *onto; char *detached_from; -- cgit v1.2.3