git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Taylor Blau <me@ttaylorr.com>
To: Chris Down <chris@chrisdown.name>
Cc: git@vger.kernel.org, Junio C Hamano <gitster@pobox.com>,
	Johannes Schindelin <johannes.schindelin@gmx.de>,
	Christian Couder <chriscool@tuxfamily.org>,
	kernel-team@fb.com
Subject: Re: [PATCH v2 1/2] bisect: output state before we are ready to compute bisection
Date: Thu, 5 May 2022 22:52:08 -0400	[thread overview]
Message-ID: <YnSNWMBRZA0S8X26@nand.local> (raw)
In-Reply-To: <11edd3e4dbaac7fada8a3bcd43f4bbd353087637.1651796862.git.chris@chrisdown.name>

On Fri, May 06, 2022 at 01:52:46AM +0100, Chris Down wrote:
> In order to avoid situations like this, make it more clear what we're
> waiting for:
>
>     $ git bisect start d93ff48803f0 v6.3
>     status: waiting for good commit(s), bad commit known

Makes sense. It would be kind of nice to realize that (in your example)
"v6.3" likely wasn't a pathspec that matched any files, either, and
after trying to DWIM it into something sensible, printed an error and
quit.

But I think the behavior here is slightly more subtle, since we really
care about whether or not a pathspec would match any revisions along the
bisection, not just the tips or the currently checked-out revision.

So I think the approach here makes sense.

> +static void bisect_print_status(const struct bisect_terms *terms)
> +{
> +	const struct bisect_state bs = bisect_status(terms);
> +
> +	/* If we had both, we'd already be started, and shouldn't get here. */
> +	if (bs.nr_good && bs.nr_bad)
> +		return;
> +
> +	if (!bs.nr_good && !bs.nr_bad)
> +		printf(_("status: waiting for both good and bad commits\n"));
> +	else if (bs.nr_good)
> +		printf(Q_("status: waiting for bad commit, %d good commit known\n",
> +			  "status: waiting for bad commit, %d good commits known\n",
> +			  bs.nr_good), bs.nr_good);
> +	else
> +		printf(_("status: waiting for good commit(s), bad commit known\n"));
> +}

Could or should these printf()'s be advise() calls instead? That would
make it easier for users to turn them off if they don't want the extra
output. At the very least, we should make sure that they are sent to
stderr to discourage scripting around them.

Thanks,
Taylor

  reply	other threads:[~2022-05-06  2:52 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-06  0:52 [PATCH v2 0/2] bisect: status improvements when bisect is not fully fleshed out Chris Down
2022-05-06  0:52 ` [PATCH v2 1/2] bisect: output state before we are ready to compute bisection Chris Down
2022-05-06  2:52   ` Taylor Blau [this message]
2022-05-06 10:14     ` Chris Down
2022-05-06 16:42     ` Junio C Hamano
2022-05-06 18:12   ` Junio C Hamano
2022-05-06  0:52 ` [PATCH v2 2/2] bisect: output bisect setup status in bisect log Chris Down
2022-05-06  3:03   ` Taylor Blau
2022-05-06 10:09     ` Chris Down
2022-05-09 15:41       ` Taylor Blau
2022-05-06 16:57     ` Junio C Hamano
2022-05-06 16:47   ` Junio C Hamano
2022-05-06 18:18   ` Junio C Hamano
2022-05-09 15:43     ` Taylor Blau
2022-05-09 16:08       ` Junio C Hamano
2022-05-09 16:27         ` Taylor Blau
2022-05-07 10:58 ` [PATCH v2 0/2] bisect: status improvements when bisect is not fully fleshed out Chris Down
2022-05-07 18:25   ` Junio C Hamano
2022-05-07 21:22     ` Chris Down

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YnSNWMBRZA0S8X26@nand.local \
    --to=me@ttaylorr.com \
    --cc=chris@chrisdown.name \
    --cc=chriscool@tuxfamily.org \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=johannes.schindelin@gmx.de \
    --cc=kernel-team@fb.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).