Skip to content

Commit 58786d7

Browse files
sgnttaylorr
authored andcommitted
bisect--helper: remove unused options
'git-bisect.sh' used to have a 'bisect_next_check' to check if we have both good/bad, old/new terms set or not. In commit 129a6cf (bisect--helper: `bisect_next_check` shell function in C, 2019-01-02), a subcommand for bisect--helper was introduced to port the check to C. Since d1bbbe4 (bisect--helper: reimplement `bisect_run` shell function in C, 2021-09-13), all users of 'bisect_next_check' was re-implemented in C, this subcommand was no longer used but we forgot to remove '--bisect-next-check'. 'git-bisect.sh' also used to have a 'bisect_write' function, whose third positional parameter was a "nolog" flag. This flag was only used when 'bisect_start' invoked 'bisect_write' to write the starting good and bad revisions. Then 0f30233 (bisect--helper: `bisect_write` shell function in C, 2019-01-02) ported it to C as a command mode of 'bisect--helper', which (incorrectly) added the '--no-log' option, and convert the only place ('bisect_start') that call 'bisect_write' with 'nolog' to 'git bisect--helper --bisect-write' with 'nolog' instead of '--no-log', since 'bisect--helper' has command modes not subcommands, all other command modes see and handle that option as well. This bogus state didn't last long, however, because in the same patch series 06f5608 (bisect--helper: `bisect_start` shell function partially in C, 2019-01-02) the C reimplementation of bisect_start() started calling the bisect_write() C function, this time with the right 'nolog' function parameter. From then on there was no need for the '--no-log' option in 'bisect--helper'. Eventually all bisect subcommands were ported to C as 'bisect--helper' command modes, each calling the bisect_write() C function instead, but when the '--bisect-write' command mode was removed in 68efed8 (bisect--helper: retire `--bisect-write` subcommand, 2021-02-03) it forgot to remove that '--no-log' option. '--no-log' option had never been used and it's unused now. Let's remove --bisect-next-check and --no-log from option parsing. Signed-off-by: Đoàn Trần Công Danh <[email protected]> Signed-off-by: Taylor Blau <[email protected]>
1 parent 3b08839 commit 58786d7

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

builtin/bisect--helper.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1281,7 +1281,6 @@ int cmd_bisect__helper(int argc, const char **argv, const char *prefix)
12811281
{
12821282
enum {
12831283
BISECT_RESET = 1,
1284-
BISECT_NEXT_CHECK,
12851284
BISECT_TERMS,
12861285
BISECT_START,
12871286
BISECT_AUTOSTART,
@@ -1293,12 +1292,10 @@ int cmd_bisect__helper(int argc, const char **argv, const char *prefix)
12931292
BISECT_VISUALIZE,
12941293
BISECT_RUN,
12951294
} cmdmode = 0;
1296-
int res = 0, nolog = 0;
1295+
int res = 0;
12971296
struct option options[] = {
12981297
OPT_CMDMODE(0, "bisect-reset", &cmdmode,
12991298
N_("reset the bisection state"), BISECT_RESET),
1300-
OPT_CMDMODE(0, "bisect-next-check", &cmdmode,
1301-
N_("check whether bad or good terms exist"), BISECT_NEXT_CHECK),
13021299
OPT_CMDMODE(0, "bisect-terms", &cmdmode,
13031300
N_("print out the bisect terms"), BISECT_TERMS),
13041301
OPT_CMDMODE(0, "bisect-start", &cmdmode,
@@ -1317,8 +1314,6 @@ int cmd_bisect__helper(int argc, const char **argv, const char *prefix)
13171314
N_("visualize the bisection"), BISECT_VISUALIZE),
13181315
OPT_CMDMODE(0, "bisect-run", &cmdmode,
13191316
N_("use <cmd>... to automatically bisect"), BISECT_RUN),
1320-
OPT_BOOL(0, "no-log", &nolog,
1321-
N_("no log for BISECT_WRITE")),
13221317
OPT_END()
13231318
};
13241319
struct bisect_terms terms = { .term_good = NULL, .term_bad = NULL };

0 commit comments

Comments
 (0)