git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v4 1/2] bisect: let bisect_reset() optionally check out quietly

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 1, 2026, 19:15 UTC
Message-ID
<xmqqa4r58xem.fsf@gitster.g>
In-Reply-To
<e39670edf4be8bc917a985666f200a88880212ce.1785577445.git.gitgitgadget@gmail.com>
"Harald Nordgren via GitGitGadget" <gitgitgadget@gmail.com> writes:
Show 23 quoted lines
> From: Harald Nordgren <haraldnordgren@gmail.com>
>
> Add a "quiet" parameter to bisect_reset() that passes "--quiet" to the
> checkout restoring the original HEAD, suppressing its progress and
> branch-status output.
>
> No caller sets the flag yet, so behavior is unchanged.
>
> Signed-off-by: Harald Nordgren <haraldnordgren@gmail.com>
> ---
>  builtin/bisect.c | 12 +++++++-----
>  1 file changed, 7 insertions(+), 5 deletions(-)
>
> diff --git a/builtin/bisect.c b/builtin/bisect.c
> index 3264e2da54..1e0c043249 100644
> --- a/builtin/bisect.c
> +++ b/builtin/bisect.c
> @@ -234,7 +234,7 @@ static int write_terms(const char *bad, const char *good)
>  	return res;
>  }
>  
> -static int bisect_reset(const char *commit)
> +static int bisect_reset(const char *commit, int quiet)

Not a huge deal but given that you are adding "bool defer_reset" in the next step, it may be more consistent to add this also as a bool?

Show 31 quoted lines
> @@ -255,8 +255,10 @@ static int bisect_reset(const char *commit)
>  		struct child_process cmd = CHILD_PROCESS_INIT;
>  
>  		cmd.git_cmd = 1;
> -		strvec_pushl(&cmd.args, "checkout", "--ignore-other-worktrees",
> -				branch.buf, "--", NULL);
> +		strvec_pushl(&cmd.args, "checkout", "--ignore-other-worktrees", NULL);
> +		if (quiet)
> +			strvec_push(&cmd.args, "--quiet");
> +		strvec_pushl(&cmd.args, branch.buf, "--", NULL);
>  		if (run_command(&cmd)) {
>  			error(_("could not check out original"
>  				" HEAD '%s'. Try 'git bisect"
> @@ -1096,7 +1098,7 @@ static enum bisect_error bisect_replay(struct bisect_terms *terms, const char *f
>  	if (is_empty_or_missing_file(filename))
>  		return error(_("cannot read file '%s' for replaying"), filename);
>  
> -	if (bisect_reset(NULL))
> +	if (bisect_reset(NULL, 0))
>  		return BISECT_FAILED;
>  
>  	fp = fopen(filename, "r");
> @@ -1345,7 +1347,7 @@ static int cmd_bisect__reset(int argc, const char **argv, const char *prefix UNU
>  	if (argc > 1)
>  		return error(_("'%s' requires either no argument or a commit"),
>  			     "git bisect reset");
> -	return bisect_reset(argc ? argv[0] : NULL);
> +	return bisect_reset(argc ? argv[0] : NULL, 0);
>  }
>  
>  static int cmd_bisect__terms(int argc, const char **argv, const char *prefix UNUSED,
Previous: Harald Nordgren via GitGitGadgetNext: Harald Nordgren via GitGitGadget
Message 27 of 42 in “bisect: add --auto-reset to leave when done”
  1. 0/3 bisect: add --auto-reset to leave when doneHarald Nordgren via GitGitGadget, Jul 16, 2026
  2. 1/3 bisect: read run output from the open descriptorHarald Nordgren via GitGitGadget, Jul 16, 2026
  3. 2/3 bisect: let bisect_reset() optionally check out quietlyHarald Nordgren via GitGitGadget, Jul 16, 2026
  4. 3/3 bisect: add --auto-reset to leave when doneHarald Nordgren via GitGitGadget, Jul 16, 2026
  5. Junio C HamanoJul 16, 2026
  6. Harald NordgrenJul 16, 2026
  7. Junio C HamanoJul 17, 2026
  8. Harald NordgrenJul 17, 2026
  9. Junio C HamanoJul 17, 2026
  10. 0/3 bisect: add --auto-reset to leave when doneHarald Nordgren via GitGitGadget, Jul 17, 2026
  11. 1/3 bisect: read run output from the open descriptorHarald Nordgren via GitGitGadget, Jul 17, 2026
  12. Junio C HamanoJul 17, 2026
  13. Johannes SixtJul 18, 2026
  14. 2/3 bisect: let bisect_reset() optionally check out quietlyHarald Nordgren via GitGitGadget, Jul 17, 2026
  15. 3/3 bisect: add --auto-reset to leave when doneHarald Nordgren via GitGitGadget, Jul 17, 2026
  16. Johannes SixtJul 18, 2026
  17. Junio C HamanoJul 20, 2026
  18. 0/2 bisect: add --auto-reset to leave when doneHarald Nordgren via GitGitGadget, Jul 20, 2026
  19. 1/2 bisect: let bisect_reset() optionally check out quietlyHarald Nordgren via GitGitGadget, Jul 20, 2026
  20. 2/2 bisect: add --reset-when-found to leave when doneHarald Nordgren via GitGitGadget, Jul 20, 2026
  21. Johannes SixtJul 23, 2026
  22. Junio C HamanoJul 23, 2026
  23. Harald NordgrenAug 1, 2026
  24. Junio C HamanoJul 20, 2026
  25. 0/2 bisect: add --reset-when-found to leave when doneHarald Nordgren via GitGitGadget, Aug 1, 2026
  26. 1/2 bisect: let bisect_reset() optionally check out quietlyHarald Nordgren via GitGitGadget, Aug 1, 2026
  27. Junio C HamanoAug 1, 2026
  28. 2/2 bisect: add --reset-when-found to leave when doneHarald Nordgren via GitGitGadget, Aug 1, 2026
  29. Junio C HamanoAug 1, 2026
  30. Junio C HamanoAug 1, 2026
  31. 0/2 bisect: add --reset-when-found to leave when doneHarald Nordgren via GitGitGadget, Aug 2, 2026
  32. 1/2 bisect: let bisect_reset() optionally check out quietlyHarald Nordgren via GitGitGadget, Aug 2, 2026
  33. 2/2 bisect: add --reset-when-found to leave when doneHarald Nordgren via GitGitGadget, Aug 2, 2026
  34. Junio C HamanoAug 2, 2026
  35. 0/2 bisect: add --reset-when-found to leave when doneHarald Nordgren via GitGitGadget, Aug 2, 2026
  36. 1/2 bisect: let bisect_reset() optionally check out quietlyHarald Nordgren via GitGitGadget, Aug 2, 2026
  37. 2/2 bisect: add --reset-when-found to leave when doneHarald Nordgren via GitGitGadget, Aug 2, 2026
  38. Junio C HamanoAug 3, 2026
  39. Harald NordgrenAug 6, 2026
  40. Junio C HamanoAug 6, 2026
  41. Harald NordgrenAug 6, 2026
  42. Junio C HamanoAug 6, 2026

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.