diff mbox series

[1/3] bisect--helper: remove unused options

Message ID 489785ca45a84cffb4a2c16da15a09034829b7c6.1667561761.git.congdanhqx@gmail.com (mailing list archive)
State Superseded
Headers show
Series Convert git-bisect--helper to OPT_SUBCOMMAND | expand

Commit Message

Đoàn Trần Công Danh Nov. 4, 2022, 11:40 a.m. UTC
Signed-off-by: Đoàn Trần Công Danh <congdanhqx@gmail.com>
---
 builtin/bisect--helper.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

Comments

Jeff King Nov. 4, 2022, 12:53 p.m. UTC | #1
On Fri, Nov 04, 2022 at 06:40:10PM +0700, Đoàn Trần Công Danh wrote:

> diff --git a/builtin/bisect--helper.c b/builtin/bisect--helper.c
> index 1d2ce8a0e1..5ec2e67f59 100644
> --- a/builtin/bisect--helper.c
> +++ b/builtin/bisect--helper.c
> @@ -1283,7 +1283,6 @@ int cmd_bisect__helper(int argc, const char **argv, const char *prefix)
>  {
>  	enum {
>  		BISECT_RESET = 1,
> -		BISECT_NEXT_CHECK,
>  		BISECT_TERMS,
>  		BISECT_START,
>  		BISECT_AUTOSTART,

OK, makes sense. It might be nice to mention in the commit message how
we got here. It looks like the callers that used this went away in
d1bbbe45df (bisect--helper: reimplement `bisect_run` shell function in
C, 2021-09-13) and 5e1f28d206 (bisect--helper: reimplement
`bisect_visualize()` shell function in C, 2021-09-13).

> @@ -1319,8 +1316,6 @@ int cmd_bisect__helper(int argc, const char **argv, const char *prefix)
>  			 N_("visualize the bisection"), BISECT_VISUALIZE),
>  		OPT_CMDMODE(0, "bisect-run", &cmdmode,
>  			 N_("use <cmd>... to automatically bisect"), BISECT_RUN),
> -		OPT_BOOL(0, "no-log", &nolog,
> -			 N_("no log for BISECT_WRITE")),

Likewise digging up the history here lets us see why removing is the
right thing (and the bug is not that it _should_ be used and isn't).
Gábor posted a summary of the history elsewhere in the thread.

-Peff
diff mbox series

Patch

diff --git a/builtin/bisect--helper.c b/builtin/bisect--helper.c
index 1d2ce8a0e1..5ec2e67f59 100644
--- a/builtin/bisect--helper.c
+++ b/builtin/bisect--helper.c
@@ -1283,7 +1283,6 @@  int cmd_bisect__helper(int argc, const char **argv, const char *prefix)
 {
 	enum {
 		BISECT_RESET = 1,
-		BISECT_NEXT_CHECK,
 		BISECT_TERMS,
 		BISECT_START,
 		BISECT_AUTOSTART,
@@ -1295,12 +1294,10 @@  int cmd_bisect__helper(int argc, const char **argv, const char *prefix)
 		BISECT_VISUALIZE,
 		BISECT_RUN,
 	} cmdmode = 0;
-	int res = 0, nolog = 0;
+	int res = 0;
 	struct option options[] = {
 		OPT_CMDMODE(0, "bisect-reset", &cmdmode,
 			 N_("reset the bisection state"), BISECT_RESET),
-		OPT_CMDMODE(0, "bisect-next-check", &cmdmode,
-			 N_("check whether bad or good terms exist"), BISECT_NEXT_CHECK),
 		OPT_CMDMODE(0, "bisect-terms", &cmdmode,
 			 N_("print out the bisect terms"), BISECT_TERMS),
 		OPT_CMDMODE(0, "bisect-start", &cmdmode,
@@ -1319,8 +1316,6 @@  int cmd_bisect__helper(int argc, const char **argv, const char *prefix)
 			 N_("visualize the bisection"), BISECT_VISUALIZE),
 		OPT_CMDMODE(0, "bisect-run", &cmdmode,
 			 N_("use <cmd>... to automatically bisect"), BISECT_RUN),
-		OPT_BOOL(0, "no-log", &nolog,
-			 N_("no log for BISECT_WRITE")),
 		OPT_END()
 	};
 	struct bisect_terms terms = { .term_good = NULL, .term_bad = NULL };