summaryrefslogtreecommitdiff
path: root/wt-status.h
diff options
context:
space:
mode:
authorElijah Newren <newren@gmail.com>2020-06-18 20:49:57 (GMT)
committerJunio C Hamano <gitster@pobox.com>2020-06-18 21:12:28 (GMT)
commit051df3cfe8ed7d113197636f860edea14f283037 (patch)
tree09a2af475e33e75965cd601f9bec3fedb1c8371e /wt-status.h
parent101b3204f37606972b40fc17dec84560c22f69f6 (diff)
downloadgit-051df3cfe8ed7d113197636f860edea14f283037.zip
git-051df3cfe8ed7d113197636f860edea14f283037.tar.gz
git-051df3cfe8ed7d113197636f860edea14f283037.tar.bz2
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.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/wt-status.h b/wt-status.h
index 73ab5d4..f1fa0ec 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;