git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Ramkumar Ramachandra" <r@artagnon.com>
To: "René Scharfe" <l.s.r@web.de>, "Git List" <git@vger.kernel.org>
Cc: "Christian Couder" <christian.couder@gmail.com>,
	"Miriam R." <mirucam@gmail.com>,
	"Junio C Hamano" <gitster@pobox.com>
Subject: Re: [PATCH v2 4/4] bisect--helper: double-check run command on exit code 126 and 127
Date: Fri, 04 Feb 2022 19:09:35 +0100	[thread overview]
Message-ID: <e04aa856-07e2-474f-88ec-af5d47d9f640@www.fastmail.com> (raw)
In-Reply-To: <20987dc6-e0c7-6ca2-19fd-2b323b3f6d9f@web.de>

René Scharfe wrote:
> The workaround used by this patch is to run the command on a known-good
> revision and abort if we still get the same error code.  This adds one
> step to runs with scripts that use exit codes 126 and 127, but keeps
> them supported, with one exception: It won't work with commands that
> cannot recognize the (manually marked) known-good revision as such.
>
> Run commands that use low exit codes are unaffected.  Typos are reported
> after executing the missing command twice and three checkouts (the first
> step, the known good revision and back to the revision of the first
> step).

I'm happy with the description of this patch. It doesn't add an extra step for an overwhelming majority of users, while not breaking backward compatibility.
 
> --- a/builtin/bisect--helper.c
> +++ b/builtin/bisect--helper.c
> @@ -1089,6 +1089,44 @@ static int bisect_visualize(struct bisect_terms *terms, const char **argv, int a
> +static int get_first_good(const char *refname, const struct object_id *oid,
> +   int flag, void *cb_data)
> +{
> + oidcpy(cb_data, oid);
> + return 1;

I assume you return 1 here to stop the for_each_glob_ref() iteration, after copying the oid.

> @@ -1113,6 +1152,30 @@ static int bisect_run(struct bisect_terms *terms, const char **argv, int argc)
> + int rc = verify_good(terms, run_args.v);
> + is_first_run = 0;
> + if (rc < 0) {
> + error(_("unable to verify '%s' on good"
> + " revision"), command.buf);

Perhaps in a subsequent patch, we can consider sha1_abbrev() to print nicer messages everywhere in bisect.

> diff --git a/t/t6030-bisect-porcelain.sh b/t/t6030-bisect-porcelain.sh
> index fc18796517..5382e5d216 100755
> --- a/t/t6030-bisect-porcelain.sh
> +++ b/t/t6030-bisect-porcelain.sh
> @@ -290,7 +290,7 @@ test_expect_success 'bisect run accepts exit code 126 as bad' '
> -test_expect_failure POSIXPERM 'bisect run fails with non-executable test script' '
> +test_expect_success POSIXPERM 'bisect run fails with non-executable test script' '

> -test_expect_failure 'bisect run fails with missing test script' '
> +test_expect_success 'bisect run fails with missing test script' '

Yes, these are precisely the two problems I had.

Thanks.

Warm regards,
Ram

      parent reply	other threads:[~2022-02-04 18:09 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-09 19:29 git bisect bad @ Ramkumar Ramachandra
2022-01-09 19:54 ` Junio C Hamano
2022-01-09 20:48   ` Ramkumar Ramachandra
2022-01-10  9:01     ` [PATCH] bisect: report actual bisect_state() argument on error René Scharfe
2022-01-10 10:04       ` Ramkumar Ramachandra
2022-01-10 17:06     ` git bisect bad @ Junio C Hamano
2022-01-10 21:04       ` Ramkumar Ramachandra
2022-01-12  9:04         ` René Scharfe
2022-01-12 17:50           ` Junio C Hamano
2022-01-12 18:34             ` René Scharfe
2022-01-13  5:10               ` René Scharfe
2022-01-13  9:32                 ` Ramkumar Ramachandra
2022-01-13 12:28                   ` Christian Couder
2022-01-13 13:55                     ` René Scharfe
2022-01-13 15:16                       ` Ramkumar Ramachandra
2022-01-14  7:47                         ` René Scharfe
2022-01-14  8:04                           ` Ramkumar Ramachandra
2022-01-18 12:45                             ` René Scharfe
2022-01-14 18:42                           ` Junio C Hamano
2022-01-13 18:40                       ` Junio C Hamano
2022-01-18 12:45     ` [PATCH v2 1/4] bisect--helper: report actual bisect_state() argument on error René Scharfe
2022-01-18 12:46     ` [PATCH v2 2/4] bisect--helper: release strbuf and strvec on run error René Scharfe
2022-01-18 12:46     ` [PATCH v2 3/4] bisect: document run behavior with exit codes 126 and 127 René Scharfe
2022-01-18 12:46     ` [PATCH v2 4/4] bisect--helper: double-check run command on exit code " René Scharfe
2022-01-19  2:36       ` Junio C Hamano
2022-01-19  7:52         ` René Scharfe
2022-02-04  0:42       ` Junio C Hamano
2022-02-04 17:16         ` René Scharfe
2022-02-04 18:16         ` Ramkumar Ramachandra
2022-02-04 19:32           ` Junio C Hamano
2022-02-04 18:09       ` Ramkumar Ramachandra [this message]

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

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

  git send-email \
    --in-reply-to=e04aa856-07e2-474f-88ec-af5d47d9f640@www.fastmail.com \
    --to=r@artagnon.com \
    --cc=christian.couder@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=l.s.r@web.de \
    --cc=mirucam@gmail.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.
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 NNTP newsgroup(s).