diff options
author | Elijah Newren <newren@gmail.com> | 2020-06-18 22:49:57 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2020-06-18 23:12:28 +0200 |
commit | 051df3cfe8ed7d113197636f860edea14f283037 (patch) | |
tree | 09a2af475e33e75965cd601f9bec3fedb1c8371e /wt-status.h | |
parent | The third batch (diff) | |
download | git-051df3cfe8ed7d113197636f860edea14f283037.tar.xz git-051df3cfe8ed7d113197636f860edea14f283037.zip |
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 <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'wt-status.h')
-rw-r--r-- | wt-status.h | 2 |
1 files changed, 2 insertions, 0 deletions
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; |