{"thread":{"id":"22056","subject":"[PATCH] commit: --cleanup is a message option","startedAt":"2009-12-29T21:54:49Z","lastAt":"2009-12-29T21:54:49Z","messageCount":1,"participants":["Greg Price"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"130496","messageId":"1262123689-28789-1-git-send-email-price@ksplice.com","threadId":"22056","inReplyTo":null,"subject":"[PATCH] commit: --cleanup is a message option","fromName":"Greg Price","fromEmail":"price@ksplice.com","sentAt":"2009-12-29T21:54:49Z","receivedAt":"2009-12-29T21:54:49Z","isPatch":true,"sender":{"key":"price@mit.edu","avatar":"https://avatars.githubusercontent.com/u/28173?v=4"},"body":"In the usage message for \"git commit\", the --cleanup option appeared\nat the end, as one of the \"contents options\":\n\nusage: git commit [options] [--] <filepattern>...\n...\nCommit message options\n...\nCommit contents options\n...\n    --allow-empty         ok to record an empty change\n    --cleanup <default>   how to strip spaces and #comments from message\n\nThis is confusing, in part because it makes it ambiguous whether\n--allow-empty, just above, refers to an empty diff or an empty message.\n\nMove --cleanup into the 'message options' group.  Also add a pair of\ncomments to prevent similar oversights in the future.\n\nSigned-off-by: Greg Price <price@ksplice.com>\n---\nApologies to Junio for the duplicate; vger.kernel.org didn't like the envelope\nsender on my last message.\n\n builtin-commit.c |    6 ++++--\n 1 files changed, 4 insertions(+), 2 deletions(-)\n\ndiff --git a/builtin-commit.c b/builtin-commit.c\nindex f54772f..33aa593 100644\n--- a/builtin-commit.c\n+++ b/builtin-commit.c\n@@ -86,8 +86,8 @@ static int opt_parse_m(const struct option *opt, const char *arg, int unset)\n static struct option builtin_commit_options[] = {\n \tOPT__QUIET(&quiet),\n \tOPT__VERBOSE(&verbose),\n-\tOPT_GROUP(\"Commit message options\"),\n \n+\tOPT_GROUP(\"Commit message options\"),\n \tOPT_FILENAME('F', \"file\", &logfile, \"read log from file\"),\n \tOPT_STRING(0, \"author\", &force_author, \"AUTHOR\", \"override author for commit\"),\n \tOPT_CALLBACK('m', \"message\", &message, \"MESSAGE\", \"specify commit message\", opt_parse_m),\n@@ -97,6 +97,8 @@ static struct option builtin_commit_options[] = {\n \tOPT_BOOLEAN('s', \"signoff\", &signoff, \"add Signed-off-by:\"),\n \tOPT_FILENAME('t', \"template\", &template_file, \"use specified template file\"),\n \tOPT_BOOLEAN('e', \"edit\", &edit_flag, \"force edit of commit\"),\n+\tOPT_STRING(0, \"cleanup\", &cleanup_arg, \"default\", \"how to strip spaces and #comments from message\"),\n+\t/* end commit message options */\n \n \tOPT_GROUP(\"Commit contents options\"),\n \tOPT_BOOLEAN('a', \"all\", &all, \"commit all changed files\"),\n@@ -108,7 +110,7 @@ static struct option builtin_commit_options[] = {\n \tOPT_BOOLEAN(0, \"amend\", &amend, \"amend previous commit\"),\n \t{ 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\" },\n \tOPT_BOOLEAN(0, \"allow-empty\", &allow_empty, \"ok to record an empty change\"),\n-\tOPT_STRING(0, \"cleanup\", &cleanup_arg, \"default\", \"how to strip spaces and #comments from message\"),\n+\t/* end commit contents options */\n \n \tOPT_END()\n };\n-- \n1.6.6\n"}]}