diff options
author | Junio C Hamano <gitster@pobox.com> | 2017-05-10 19:46:11 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-05-10 19:46:11 -0700 |
commit | 212de7445d463405f01efe2bcae8419c8873bb56 (patch) | |
tree | cab980ad918a36af1b88225425ca5300fb9b48ae | |
parent | b203494c42a31924f92ee1d08cd72af3c69392ba (diff) | |
download | git-mg/status-in-progress-info.tar.gz |
status --short --inprogress: spell it as --in-progressmg/status-in-progress-info
I think the option should be discarded and instead the new
information should be emitted unconditonally, but while I am waiting
for other people's opinion, at least we should spell the option in a
more readable way.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r-- | Documentation/config.txt | 6 | ||||
-rw-r--r-- | Documentation/git-status.txt | 3 | ||||
-rw-r--r-- | builtin/commit.c | 16 | ||||
-rwxr-xr-x | t/t7512-status-help.sh | 12 | ||||
-rw-r--r-- | wt-status.c | 10 | ||||
-rw-r--r-- | wt-status.h | 2 |
6 files changed, 24 insertions, 25 deletions
diff --git a/Documentation/config.txt b/Documentation/config.txt index 3adc65f9d3..9372abe533 100644 --- a/Documentation/config.txt +++ b/Documentation/config.txt @@ -2957,9 +2957,9 @@ status.branch:: Set to true to enable --branch by default in linkgit:git-status[1]. The option --no-branch takes precedence over this variable. -status.inprogress:: - Set to true to enable --inprogress by default in linkgit:git-status[1]. - The option --no-inprogress takes precedence over this variable. +status.inProgress:: + Set to true to enable --in-progress by default in linkgit:git-status[1]. + The option --no-in-progress takes precedence over this variable. status.displayCommentPrefix:: If set to true, linkgit:git-status[1] will insert a comment diff --git a/Documentation/git-status.txt b/Documentation/git-status.txt index 4fac073247..afbdd970af 100644 --- a/Documentation/git-status.txt +++ b/Documentation/git-status.txt @@ -32,8 +32,7 @@ OPTIONS --branch:: Show the branch and tracking info even in short-format. --p:: ---inprogress:: +--in-progress:: When showing branch and tracking info in short-format, show in-progress information (BISECTING, MERGING etc.), too. diff --git a/builtin/commit.c b/builtin/commit.c index 6176dd2c2f..dd545daba7 100644 --- a/builtin/commit.c +++ b/builtin/commit.c @@ -1105,7 +1105,7 @@ static const char *read_commit_message(const char *name) static struct status_deferred_config { enum wt_status_format status_format; int show_branch; - int show_inprogress; + int show_in_progress; } status_deferred_config = { STATUS_FORMAT_UNSPECIFIED, -1, /* unspecified */ @@ -1135,10 +1135,10 @@ static void finalize_deferred_config(struct wt_status *s) s->show_branch = status_deferred_config.show_branch; if (s->show_branch < 0) s->show_branch = 0; - if (use_deferred_config && s->show_inprogress < 0) - s->show_inprogress = status_deferred_config.show_inprogress; - if (s->show_inprogress < 0) - s->show_inprogress = 0; + if (use_deferred_config && s->show_in_progress < 0) + s->show_in_progress = status_deferred_config.show_in_progress; + if (s->show_in_progress < 0) + s->show_in_progress = 0; } static int parse_and_validate_options(int argc, const char *argv[], @@ -1298,7 +1298,7 @@ static int git_status_config(const char *k, const char *v, void *cb) return 0; } if (!strcmp(k, "status.inprogress")) { - status_deferred_config.show_inprogress = git_config_bool(k, v); + status_deferred_config.show_in_progress = git_config_bool(k, v); return 0; } if (!strcmp(k, "status.color") || !strcmp(k, "color.status")) { @@ -1349,7 +1349,7 @@ int cmd_status(int argc, const char **argv, const char *prefix) N_("show status concisely"), STATUS_FORMAT_SHORT), OPT_BOOL('b', "branch", &s.show_branch, N_("show branch information")), - OPT_BOOL('p', "inprogress", &s.show_inprogress, + OPT_BOOL(0, "in-progress", &s.show_in_progress, N_("show in-progress information")), { OPTION_CALLBACK, 0, "porcelain", &status_format, N_("version"), N_("machine-readable output"), @@ -1624,7 +1624,7 @@ int cmd_commit(int argc, const char **argv, const char *prefix) OPT_SET_INT(0, "short", &status_format, N_("show status concisely"), STATUS_FORMAT_SHORT), OPT_BOOL(0, "branch", &s.show_branch, N_("show branch information")), - OPT_BOOL(0, "inprogress", &s.show_inprogress, N_("show in-progress information")), + OPT_BOOL(0, "in-progress", &s.show_in_progress, N_("show in-progress information")), OPT_SET_INT(0, "porcelain", &status_format, N_("machine-readable output"), STATUS_FORMAT_PORCELAIN), OPT_SET_INT(0, "long", &status_format, diff --git a/t/t7512-status-help.sh b/t/t7512-status-help.sh index 103e006249..f3d034b5be 100755 --- a/t/t7512-status-help.sh +++ b/t/t7512-status-help.sh @@ -101,7 +101,7 @@ test_expect_success 'short status when rebase in progress' ' ## HEAD (no branch); REBASE-m UU main.txt EOF - git status --untracked-files=no --short --branch --inprogress >actual && + git status --untracked-files=no --short --branch --in-progress >actual && test_i18ncmp expected actual ' @@ -172,7 +172,7 @@ test_expect_success 'short status during rebase -i when conflicts unresolved' ' ## HEAD (no branch); REBASE-i UU main.txt EOF - git status --untracked-files=no --short --branch --inprogress >actual && + git status --untracked-files=no --short --branch --in-progress >actual && test_i18ncmp expected actual ' @@ -650,7 +650,7 @@ test_expect_success 'short status in an am session: file already exists' ' cat >expected <<\EOF && ## am_already_exists; AM EOF - git status --untracked-files=no --short --branch --inprogress >actual && + git status --untracked-files=no --short --branch --in-progress >actual && test_i18ncmp expected actual ' @@ -725,7 +725,7 @@ test_expect_success 'short status when bisecting' ' cat >expected <<EOF && ## HEAD (no branch); BISECTING EOF - git status --untracked-files=no --short --branch --inprogress >actual && + git status --untracked-files=no --short --branch --in-progress >actual && test_i18ncmp expected actual ' @@ -792,7 +792,7 @@ test_expect_success 'short status when cherry-picking before resolving conflicts ## cherry_branch; CHERRY-PICKING UU main.txt EOF - git status --untracked-files=no --short --branch --inprogress >actual && + git status --untracked-files=no --short --branch --in-progress >actual && test_i18ncmp expected actual ' @@ -871,7 +871,7 @@ test_expect_success 'short status while reverting commit (conflicts)' ' ## master; REVERTING UU to-revert.txt EOF - git status --untracked-files=no --short --branch --inprogress >actual && + git status --untracked-files=no --short --branch --in-progress >actual && test_i18ncmp expected actual ' diff --git a/wt-status.c b/wt-status.c index f4606d27c8..a153dc5de0 100644 --- a/wt-status.c +++ b/wt-status.c @@ -1739,7 +1739,7 @@ static void wt_shortstatus_print_tracking(struct wt_status *s) if (!strcmp(s->branch, "HEAD")) { color_fprintf(s->fp, color(WT_STATUS_NOBRANCH, s), "%s", LABEL(N_("HEAD (no branch)"))); - goto inprogress; + goto in_progress; } skip_prefix(branch_name, "refs/heads/", &branch_name); @@ -1750,7 +1750,7 @@ static void wt_shortstatus_print_tracking(struct wt_status *s) if (stat_tracking_info(branch, &num_ours, &num_theirs, &base) < 0) { if (!base) - goto inprogress; + goto in_progress; upstream_is_gone = 1; } @@ -1761,7 +1761,7 @@ static void wt_shortstatus_print_tracking(struct wt_status *s) free((char *)base); if (!upstream_is_gone && !num_ours && !num_theirs) - goto inprogress; + goto in_progress; color_fprintf(s->fp, header_color, " ["); if (upstream_is_gone) { @@ -1781,8 +1781,8 @@ static void wt_shortstatus_print_tracking(struct wt_status *s) color_fprintf(s->fp, header_color, "]"); - inprogress: - if (!s->show_inprogress) + in_progress: + if (!s->show_in_progress) goto conclude; memset(&state, 0, sizeof(state)); wt_status_get_state(&state, diff --git a/wt-status.h b/wt-status.h index 8f6c9e0e62..65c3f43026 100644 --- a/wt-status.h +++ b/wt-status.h @@ -77,7 +77,7 @@ struct wt_status { unsigned colopts; int null_termination; int show_branch; - int show_inprogress; + int show_in_progress; int hints; enum wt_status_format status_format; |