Currently, the long option "--all" does different things for "add" (it is "-A") and "commit" (it is "-a"). Rename the "commit" long option to "--all-tracked" which conveys the fact that it is about all tracked files only. Also, rename the corresponding static int in code from "all" to "alltracked" to help future coders. Signed-off-by: Michael J Gruber <git@xxxxxxxxxxxxxxxxxxxx> --- Documentation/git-commit.txt | 2 +- builtin/commit.c | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Documentation/git-commit.txt b/Documentation/git-commit.txt index 411fa68..70ddb81 100644 --- a/Documentation/git-commit.txt +++ b/Documentation/git-commit.txt @@ -54,7 +54,7 @@ that, you can recover from it with 'git reset'. OPTIONS ------- -a:: ---all:: +--all-tracked:: Tell the command to automatically stage files that have been modified and deleted, but new files you have not told git about are not affected. diff --git a/builtin/commit.c b/builtin/commit.c index d279a84..be0f075 100644 --- a/builtin/commit.c +++ b/builtin/commit.c @@ -83,7 +83,7 @@ static const char *template_file; static const char *author_message, *author_message_buffer; static char *edit_message, *use_message; static char *fixup_message, *squash_message; -static int all, edit_flag, also, interactive, only, amend, signoff; +static int alltracked, edit_flag, also, interactive, only, amend, signoff; static int quiet, verbose, no_verify, allow_empty, dry_run, renew_authorship; static int no_post_rewrite, allow_empty_message; static char *untracked_files_arg, *force_date, *ignore_submodule_arg; @@ -149,7 +149,7 @@ static struct option builtin_commit_options[] = { /* end commit message options */ OPT_GROUP("Commit contents options"), - OPT_BOOLEAN('a', "all", &all, "commit all changed files"), + OPT_BOOLEAN('a', "all-tracked", &alltracked, "commit all changed tracked files"), OPT_BOOLEAN('i', "include", &also, "add specified files to index for commit"), OPT_BOOLEAN(0, "interactive", &interactive, "interactively add files"), OPT_BOOLEAN('o', "only", &only, "commit only specified files"), @@ -367,7 +367,7 @@ static char *prepare_index(int argc, const char **argv, const char *prefix, int * (A) if all goes well, commit the real index; * (B) on failure, rollback the real index. */ - if (all || (also && pathspec && *pathspec)) { + if (alltracked || (also && pathspec && *pathspec)) { fd = hold_locked_index(&index_lock, 1); add_files_to_cache(also ? prefix : NULL, pathspec, 0); refresh_cache_or_die(refresh_flags); @@ -1040,8 +1040,8 @@ static int parse_and_validate_options(int argc, const char *argv[], author_message_buffer = read_commit_message(author_message); } - if (!!also + !!only + !!all + !!interactive > 1) - die("Only one of --include/--only/--all/--interactive can be used."); + if (!!also + !!only + !!alltracked + !!interactive > 1) + die("Only one of --include/--only/--all-tracked/--interactive can be used."); if (argc == 0 && (also || (only && !amend))) die("No paths with --include/--only does not make sense."); if (argc == 0 && only && amend) @@ -1061,7 +1061,7 @@ static int parse_and_validate_options(int argc, const char *argv[], handle_untracked_files_arg(s); - if (all && argc > 0) + if (alltracked && argc > 0) die("Paths with -a does not make sense."); else if (interactive && argc > 0) die("Paths with --interactive does not make sense."); -- 1.7.4.1.224.gefc87 -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html