diff --git a/Documentation/git-status.txt b/Documentation/git-status.txt index 9f3a78a36c..4acf690a8b 100644 --- a/Documentation/git-status.txt +++ b/Documentation/git-status.txt @@ -111,6 +111,13 @@ configuration variable documented in linkgit:git-config[1]. without options are equivalent to 'always' and 'never' respectively. +--no-lock-index:: +--lock-index:: + (DEPRECATED: use --no-optional-locks instead) + Specifies whether `git status` should try to lock the index and + update it afterwards if any changes were detected. Defaults to + `--lock-index`. + ...:: See the 'pathspec' entry in linkgit:gitglossary[7]. diff --git a/builtin/commit.c b/builtin/commit.c index d75b3805ea..8b26f9fc39 100644 --- a/builtin/commit.c +++ b/builtin/commit.c @@ -1340,6 +1340,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 struct wt_status s; int fd; struct object_id oid; @@ -1369,12 +1370,20 @@ 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, "no-lock-index", &no_lock_index, + N_("do not lock the index")), OPT_END(), }; if (argc == 2 && !strcmp(argv[1], "-h")) usage_with_options(builtin_status_usage, builtin_status_options); + if (no_lock_index) { + warning("--no-lock-index is deprecated, use --no-optional-locks" + " instead"); + setenv(GIT_OPTIONAL_LOCKS_ENVIRONMENT, "false", 1); + } + status_init_config(&s, git_status_config); argc = parse_options(argc, argv, prefix, builtin_status_options,