summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 1b908b6)
raw | patch | inline | side by side (parent: 1b908b6)
author | Junio C Hamano <gitster@pobox.com> | |
Sat, 10 Apr 2010 07:33:17 +0000 (00:33 -0700) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Sat, 10 Apr 2010 07:43:59 +0000 (00:43 -0700) |
There is no stronger reason behind the choice of "!!" than just I happened
to have typed them.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
to have typed them.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/commit.c | patch | blob | history | |
wt-status.c | patch | blob | history |
diff --git a/builtin/commit.c b/builtin/commit.c
index c5ab683d5b66d5ad85f53d13d6df71e29cd9234d..761ca0704749980bb4110e8e297b083bcdc6691d 100644 (file)
--- a/builtin/commit.c
+++ b/builtin/commit.c
static char *cleanup_arg;
static int use_editor = 1, initial_commit, in_merge, include_status = 1;
+static int show_ignored_in_status;
static const char *only_include_assumed;
static struct strbuf message;
"mode",
"show untracked files, optional modes: all, normal, no. (Default: all)",
PARSE_OPT_OPTARG, NULL, (intptr_t)"all" },
+ OPT_BOOLEAN(0, "ignored", &show_ignored_in_status,
+ "show ignored files"),
OPT_END(),
};
builtin_status_options,
builtin_status_usage, 0);
handle_untracked_files_arg(&s);
-
+ if (show_ignored_in_status)
+ s.show_ignored_files = 1;
if (*argv)
s.pathspec = get_pathspec(prefix, argv);
diff --git a/wt-status.c b/wt-status.c
index 2c9a05dcb4b2643f433da389eb446841f4fed2f2..7bda9953e0bd2a9a7b803e6e341d8833aaf9dd89 100644 (file)
--- a/wt-status.c
+++ b/wt-status.c
wt_status_print_submodule_summary(s, 0); /* staged */
wt_status_print_submodule_summary(s, 1); /* unstaged */
}
- if (s->show_untracked_files)
+ if (s->show_untracked_files) {
wt_status_print_other(s, &s->untracked, "Untracked", "add");
- else if (s->commitable)
+ if (s->show_ignored_files)
+ wt_status_print_other(s, &s->ignored, "Ignored", "add -f");
+ } else if (s->commitable)
fprintf(s->fp, "# Untracked files not listed (use -u option to show untracked files)\n");
if (s->verbose)
@@ -730,16 +732,16 @@ static void wt_shortstatus_status(int null_termination, struct string_list_item
}
}
-static void wt_shortstatus_untracked(int null_termination, struct string_list_item *it,
- struct wt_status *s)
+static void wt_shortstatus_other(int null_termination, struct string_list_item *it,
+ struct wt_status *s, const char *sign)
{
if (null_termination) {
- fprintf(stdout, "?? %s%c", it->string, 0);
+ fprintf(stdout, "%s %s%c", sign, it->string, 0);
} else {
struct strbuf onebuf = STRBUF_INIT;
const char *one;
one = quote_path(it->string, -1, &onebuf, s->prefix);
- color_fprintf(s->fp, color(WT_STATUS_UNTRACKED, s), "??");
+ color_fprintf(s->fp, color(WT_STATUS_UNTRACKED, s), sign);
printf(" %s\n", one);
strbuf_release(&onebuf);
}
struct string_list_item *it;
it = &(s->untracked.items[i]);
- wt_shortstatus_untracked(null_termination, it, s);
+ wt_shortstatus_other(null_termination, it, s, "??");
+ }
+ for (i = 0; i < s->ignored.nr; i++) {
+ struct string_list_item *it;
+
+ it = &(s->ignored.items[i]);
+ wt_shortstatus_other(null_termination, it, s, "!!");
}
}