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

Re: [PATCH 2/2] bisect--helper: `check_expected_revs` shell function in C

From
Eric Sunshine <sunshine@sunshineco.com>
Date
Jun 9, 2016, 21:54 UTC
Message-ID
<CAPig+cQVWng0idk0ETRQA44OsS5+GewVX=pt4uOg-=SFbL+deQ@mail.gmail.com>
In-Reply-To
<20160608152415.7770-2-pranit.bauva@gmail.com>
On Wed, Jun 8, 2016 at 11:24 AM, Pranit Bauva <pranit.bauva@gmail.com> wrote:
Show 10 quoted lines
> Reimplement the `check_expected_revs` shell function in C and add a
> `--check-expected-revs` subcommand to `git bisect--helper` to call it
> from git-bisect.sh .
> [...]
> Signed-off-by: Pranit Bauva <pranit.bauva@gmail.com>
> ---
> diff --git a/builtin/bisect--helper.c b/builtin/bisect--helper.c
> index 06bc9b8..500efd5 100644
> @@ -174,13 +174,28 @@ static int is_expected_rev(const char *expected_hex)
> +static int check_expected_revs(const char **revs, int no)

In this codebase, it's more common to name this 'nr' rather than 'no'. 'revs_nr' would also be a good name.

Show 12 quoted lines
> +{
> +       int i;
> +
> +       for (i = 0; i < no; i++) {
> +               if (!is_expected_rev(revs[i])) {
> +                       remove_path(git_path_bisect_ancestors_ok());
> +                       remove_path(git_path_bisect_expected_rev());
> +                       return 0;
> +               }
> +       }
> +       return 0;
> +}
Previous: Pranit BauvaNext: Pranit Bauva
Message 3 of 9 in “bisect--helper: `is_expected_rev` shell function in C”
  1. 1/2 bisect--helper: `is_expected_rev` shell function in CPranit Bauva, Jun 8, 2016
  2. 2/2 bisect--helper: `check_expected_revs` shell function in CPranit Bauva, Jun 8, 2016
  3. Eric SunshineJun 9, 2016
  4. Pranit BauvaJun 10, 2016
  5. Eric SunshineJun 9, 2016
  6. Eric SunshineJun 9, 2016
  7. Pranit BauvaJun 10, 2016
  8. Eric SunshineJun 10, 2016
  9. Pranit BauvaJun 11, 2016

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.