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 129a6cf344 (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 d1bbbe45df (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 0f30233a11 (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 06f5608c14 (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 68efed8c8a (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 <congdanhqx@gmail.com> Signed-off-by: Taylor Blau <me@ttaylorr.com>

Đoàn Trần Công Danh committed Nov 10, 2022 at 23:36 UTC 58786d73ba4a70e57aa4f45b1bfb696f2c420575
1 file changed +1 -6
builtin/bisect--helper.c
+1 -6
@@ -1281,7 +1281,6 @@ int cmd_bisect__helper(int argc, const char **argv, const char *prefix)
1281 {
1282 enum {
1283 BISECT_RESET = 1,
1284 - BISECT_NEXT_CHECK,
1284 BISECT_TERMS,
1285 BISECT_START,
1286 BISECT_AUTOSTART,
@@ -1293,12 +1292,10 @@ int cmd_bisect__helper(int argc, const char **argv, const char *prefix)
1292 BISECT_VISUALIZE,
1293 BISECT_RUN,
1294 } cmdmode = 0;
1296 - int res = 0, nolog = 0;
1295 + int res = 0;
1296 struct option options[] = {
1297 OPT_CMDMODE(0, "bisect-reset", &cmdmode,
1298 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),
1299 OPT_CMDMODE(0, "bisect-terms", &cmdmode,
1300 N_("print out the bisect terms"), BISECT_TERMS),
1301 OPT_CMDMODE(0, "bisect-start", &cmdmode,
@@ -1317,8 +1314,6 @@ int cmd_bisect__helper(int argc, const char **argv, const char *prefix)
1314 N_("visualize the bisection"), BISECT_VISUALIZE),
1315 OPT_CMDMODE(0, "bisect-run", &cmdmode,
1316 N_("use <cmd>... to automatically bisect"), BISECT_RUN),
1320 - OPT_BOOL(0, "no-log", &nolog,
1321 - N_("no log for BISECT_WRITE")),
1317 OPT_END()
1318 };
1319 struct bisect_terms terms = { .term_good = NULL, .term_bad = NULL };