status: reinstate --show-ignored-directory as a deprecated option

It was a bad idea to just remove that option from Git for Windows
v2.15.0, as early users of that (still experimental) option would have
been puzzled what they are supposed to do now.

So let's reintroduce the flag, but make sure to show the user good
advice how to fix this going forward.

We'll remove this option in a more orderly fashion either in v2.16.0 or
in v2.17.0.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
This commit is contained in:
Johannes Schindelin
2017-11-09 16:55:59 +01:00
parent f1d1fb5379
commit 4501c85d1b
2 changed files with 160 additions and 0 deletions

View File

@@ -1357,6 +1357,7 @@ static int git_status_config(const char *k, const char *v, void *cb)
int cmd_status(int argc, const char **argv, const char *prefix)
{
static int no_lock_index = 0;
static int show_ignored_directory = 0;
static struct wt_status s;
int fd;
struct object_id oid;
@@ -1388,6 +1389,10 @@ int cmd_status(int argc, const char **argv, const char *prefix)
N_("ignore changes to submodules, optional when: all, dirty, untracked. (Default: all)"),
PARSE_OPT_OPTARG, NULL, (intptr_t)"all" },
OPT_COLUMN(0, "column", &s.colopts, N_("list untracked files in columns")),
OPT_BOOL(0, "show-ignored-directory", &show_ignored_directory,
N_("(DEPRECATED: use --ignore=matching instead) Only "
"show directories that match an ignore pattern "
"name.")),
OPT_BOOL(0, "no-lock-index", &no_lock_index,
N_("(DEPRECATED: use `git --no-optional-locks status` "
"instead) Do not lock the index")),
@@ -1410,6 +1415,12 @@ int cmd_status(int argc, const char **argv, const char *prefix)
setenv(GIT_OPTIONAL_LOCKS_ENVIRONMENT, "false", 1);
}
if (show_ignored_directory) {
warning("--show-ignored-directory was deprecated, use "
"--ignored=matching instead");
ignored_arg = "matching";
}
handle_untracked_files_arg(&s);
handle_ignored_arg(&s);