From e97ca7f41f2b9bbdfc93d103c3f64337bb6dcc20 Mon Sep 17 00:00:00 2001 From: Greg Price Date: Tue, 29 Dec 2009 16:54:49 -0500 Subject: commit: --cleanup is a message option In the usage message for "git commit", the --cleanup option appeared at the end, as one of the "contents options": usage: git commit [options] [--] ... ... Commit message options ... Commit contents options ... --allow-empty ok to record an empty change --cleanup how to strip spaces and #comments from message This is confusing, in part because it makes it ambiguous whether --allow-empty, just above, refers to an empty diff or an empty message. Move --cleanup into the 'message options' group. Also add a pair of comments to prevent similar oversights in the future. Signed-off-by: Greg Price Signed-off-by: Junio C Hamano diff --git a/builtin-commit.c b/builtin-commit.c index fde7b89..cd4eff4 100644 --- a/builtin-commit.c +++ b/builtin-commit.c @@ -86,8 +86,8 @@ static int opt_parse_m(const struct option *opt, const char *arg, int unset) static struct option builtin_commit_options[] = { OPT__QUIET(&quiet), OPT__VERBOSE(&verbose), - OPT_GROUP("Commit message options"), + OPT_GROUP("Commit message options"), OPT_STRING('F', "file", &logfile, "FILE", "read log from file"), OPT_STRING(0, "author", &force_author, "AUTHOR", "override author for commit"), OPT_CALLBACK('m', "message", &message, "MESSAGE", "specify commit message", opt_parse_m), @@ -96,6 +96,8 @@ static struct option builtin_commit_options[] = { OPT_BOOLEAN('s', "signoff", &signoff, "add Signed-off-by:"), OPT_STRING('t', "template", &template_file, "FILE", "use specified template file"), OPT_BOOLEAN('e', "edit", &edit_flag, "force edit of commit"), + OPT_STRING(0, "cleanup", &cleanup_arg, "default", "how to strip spaces and #comments from message"), + /* end commit message options */ OPT_GROUP("Commit contents options"), OPT_BOOLEAN('a', "all", &all, "commit all changed files"), @@ -106,7 +108,7 @@ static struct option builtin_commit_options[] = { OPT_BOOLEAN(0, "amend", &amend, "amend previous commit"), { OPTION_STRING, 'u', "untracked-files", &untracked_files_arg, "mode", "show untracked files, optional modes: all, normal, no. (Default: all)", PARSE_OPT_OPTARG, NULL, (intptr_t)"all" }, OPT_BOOLEAN(0, "allow-empty", &allow_empty, "ok to record an empty change"), - OPT_STRING(0, "cleanup", &cleanup_arg, "default", "how to strip spaces and #comments from message"), + /* end commit contents options */ OPT_END() }; -- cgit v0.10.2-6-g49f6