Skip to content

Commit 6f2387c

Browse files
Jonas Rebmanngitster
authored andcommitted
bisect: use selected alternate terms in status output
Alternate bisect terms are helpful when the terms "good" and "bad" are confusing such as when bisecting for the resolution of an issue (the first good commit) rather than the introduction of a regression. If alternate terms are chosen, the terms "good" and "bad" should not be used in git's output to avoid confusion. An old/new bisect should end with $ git bisect old [sha] is the first new commit not with $ git bisect old [sha] is the first bad commit Using hardcoded good/bad vocabulary can give confusion about what action is required: status: waiting for bad commit, 1 good commit known $ git bisect bad error: Invalid command: you're currently in a new/old bisect fatal: unknown command: 'bad' To avoid confusion, use alternate terms consistently across the bisect output. Signed-off-by: Jonas Rebmann <kernel@schlaraffenlan.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent ca1db8a commit 6f2387c

File tree

1 file changed

+13
-10
lines changed

1 file changed

+13
-10
lines changed

builtin/bisect.c

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -465,13 +465,16 @@ static void bisect_print_status(const struct bisect_terms *terms)
465465
return;
466466

467467
if (!state.nr_good && !state.nr_bad)
468-
bisect_log_printf(_("status: waiting for both good and bad commits\n"));
468+
bisect_log_printf(_("status: waiting for both %s and %s commits\n"),
469+
terms->term_good, terms->term_bad);
469470
else if (state.nr_good)
470-
bisect_log_printf(Q_("status: waiting for bad commit, %d good commit known\n",
471-
"status: waiting for bad commit, %d good commits known\n",
472-
state.nr_good), state.nr_good);
471+
bisect_log_printf(Q_("status: waiting for %s commit, %d %s commit known\n",
472+
"status: waiting for %s commit, %d %s commits known\n",
473+
state.nr_good),
474+
terms->term_bad, state.nr_good, terms->term_good);
473475
else
474-
bisect_log_printf(_("status: waiting for good commit(s), bad commit known\n"));
476+
bisect_log_printf(_("status: waiting for %s commit(s), %s commit known\n"),
477+
terms->term_good, terms->term_bad);
475478
}
476479

477480
static int bisect_next_check(const struct bisect_terms *terms,
@@ -1262,14 +1265,14 @@ static int bisect_run(struct bisect_terms *terms, int argc, const char **argv)
12621265
int rc = verify_good(terms, command.buf);
12631266
is_first_run = 0;
12641267
if (rc < 0 || 128 <= rc) {
1265-
error(_("unable to verify %s on good"
1266-
" revision"), command.buf);
1268+
error(_("unable to verify %s on %s"
1269+
" revision"), command.buf, terms->term_good);
12671270
res = BISECT_FAILED;
12681271
break;
12691272
}
12701273
if (rc == res) {
1271-
error(_("bogus exit code %d for good revision"),
1272-
rc);
1274+
error(_("bogus exit code %d for %s revision"),
1275+
rc, terms->term_good);
12731276
res = BISECT_FAILED;
12741277
break;
12751278
}
@@ -1314,7 +1317,7 @@ static int bisect_run(struct bisect_terms *terms, int argc, const char **argv)
13141317
puts(_("bisect run success"));
13151318
res = BISECT_OK;
13161319
} else if (res == BISECT_INTERNAL_SUCCESS_1ST_BAD_FOUND) {
1317-
puts(_("bisect found first bad commit"));
1320+
printf(_("bisect found first %s commit\n"), terms->term_bad);
13181321
res = BISECT_OK;
13191322
} else if (res) {
13201323
error(_("bisect run failed: 'git bisect %s'"

0 commit comments

Comments
 (0)