summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 98bf8a4)
raw | patch | inline | side by side (parent: 98bf8a4)
author | Jürgen Rühle <j-r@online.de> | |
Tue, 2 Jan 2007 19:26:21 +0000 (20:26 +0100) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Wed, 3 Jan 2007 07:43:50 +0000 (23:43 -0800) |
This tries to be more to the point while also including a pointer on how to
unstage changes from the index.
Since this header is printed in two different code paths and the name of the
reference commit is needed for the unstage part, provide a new printing
function.
Signed-off-by: Jürgen Rühle <j-r@online.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
unstage changes from the index.
Since this header is printed in two different code paths and the name of the
reference commit is needed for the unstage part, provide a new printing
function.
Signed-off-by: Jürgen Rühle <j-r@online.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
wt-status.c | patch | blob | history |
diff --git a/wt-status.c b/wt-status.c
index 9b777a569e9988e250378fc4d7745ba0316a329b..8aac526440bc31e0ade55c77e6b2b6120b5132ee 100644 (file)
--- a/wt-status.c
+++ b/wt-status.c
s->workdir_clean = 1;
}
+static void wt_status_print_cached_header(const char *reference)
+{
+ const char *c = color(WT_STATUS_HEADER);
+ color_printf_ln(c, "# Cached changes to be committed:");
+ if (reference) {
+ color_printf_ln(c, "# (use \"git reset %s <file>...\" and \"git rm --cached <file>...\" to unstage)", reference);
+ } else {
+ color_printf_ln(c, "# (use \"git rm --cached <file>...\" to unstage)");
+ }
+ color_printf_ln(c, "#");
+}
+
static void wt_status_print_header(const char *main, const char *sub)
{
const char *c = color(WT_STATUS_HEADER);
if (q->queue[i]->status == 'U')
continue;
if (!shown_header) {
- wt_status_print_header("Added but not yet committed",
- "will commit");
+ wt_status_print_cached_header(s->reference);
s->commitable = 1;
shown_header = 1;
}
read_cache();
if (active_nr) {
s->commitable = 1;
- wt_status_print_header("Added but not yet committed",
- "will commit");
+ wt_status_print_cached_header(NULL);
}
for (i = 0; i < active_nr; i++) {
color_printf(color(WT_STATUS_HEADER), "#\t");