Skip to content

Commit

Permalink
Make git status usage say git status instead of git commit
Browse files Browse the repository at this point in the history
git status shares the same usage information as git commit since it
shows what would be committed if the same options are given.  However,
when displaying the usage information for git status it should say it
is for git status not git commit.

Signed-off-by: Shawn Bohrer <shawn.bohrer@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Shawn Bohrer authored and Junio C Hamano committed Dec 3, 2007
1 parent d9ccfe7 commit 2f02b25
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions builtin-commit.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ static const char * const builtin_commit_usage[] = {
NULL
};

static const char * const builtin_status_usage[] = {
"git-status [options] [--] <filepattern>...",
NULL
};

static unsigned char head_sha1[20], merge_head_sha1[20];
static char *use_message_buffer;
static const char commit_editmsg[] = "COMMIT_EDITMSG";
Expand Down Expand Up @@ -493,12 +498,12 @@ static void determine_author_info(struct strbuf *sb)
strbuf_addf(sb, "author %s\n", fmt_ident(name, email, date, 1));
}

static int parse_and_validate_options(int argc, const char *argv[])
static int parse_and_validate_options(int argc, const char *argv[],
const char * const usage[])
{
int f = 0;

argc = parse_options(argc, argv, builtin_commit_options,
builtin_commit_usage, 0);
argc = parse_options(argc, argv, builtin_commit_options, usage, 0);

if (logfile || message.len || use_message)
no_edit = 1;
Expand Down Expand Up @@ -595,7 +600,7 @@ int cmd_status(int argc, const char **argv, const char *prefix)

git_config(git_status_config);

argc = parse_and_validate_options(argc, argv);
argc = parse_and_validate_options(argc, argv, builtin_status_usage);

index_file = prepare_index(argv, prefix);

Expand Down Expand Up @@ -687,7 +692,7 @@ int cmd_commit(int argc, const char **argv, const char *prefix)

git_config(git_commit_config);

argc = parse_and_validate_options(argc, argv);
argc = parse_and_validate_options(argc, argv, builtin_commit_usage);

index_file = prepare_index(argv, prefix);

Expand Down

0 comments on commit 2f02b25

Please sign in to comment.