Subject: Re: [PATCH v2 3/4] bisect--helper: reimplement `bisect_run` shell function in C

From: Junio C Hamano <[email-masked]>
Date: Thu, 08 Apr 2021 23:15:07 -0700

Miriam Rubio <[email-masked]> writes:

> +static int bisect_run(struct bisect_terms *terms, const char **argv, int argc)
> +{
> ...
> +	while (1) {
> +		strvec_clear(&args);
> +
> +		printf(_("running %s"), command.buf);
> +		res = run_command_v_opt(run_args.v, RUN_USING_SHELL);
> +
> +		if (res < 0 && res >= 128) {

Sorry for not noticing this total nonsense during my earlier review,
but this condition will never trigger.

I would have noticed it if the style consistently used "order
quantities from left to right, as if on a number line" convention,
i.e.

		if (res < 0 && 128 <= res) {

Because there are only two valid range notation around a single
variable, which are:

    (res < 0 || 128 <= res) - meaning 'res' is outside a span, or
    (0 <= res && res < 128) - meaning 'res' is inside a span.

and the above rewriten form is neither, it would have stood out
as an error immediately.