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

Re: [PATCHv2] git bisect old/new

From
Christian Couder <christian.couder@gmail.com>
Date
Jun 13, 2012, 10:05 UTC
Message-ID
<CAP8UFD1A+GggOOb4-GYn5O1vFWpCUZ8b98Z-WOZc4gorC4p=yg@mail.gmail.com>
In-Reply-To
<1339541765-2078-1-git-send-email-Valentin.Duperray@ensimag.imag.fr>

On Wed, Jun 13, 2012 at 12:56 AM, Valentin Duperray <Valentin.Duperray@ensimag.imag.fr> wrote:

Show 7 quoted lines
>
> Related discussions:
>
>        - http://thread.gmane.org/gmane.comp.version-control.git/86063
>                introduced bisect fix unfixed to find fix.
>        - http://thread.gmane.org/gmane.comp.version-control.git/182398
>                discussion around bisect yes/no or old/new.
Thanks!
Show 15 quoted lines
>  /*
> + * The terms used for this bisect session are stocked in
> + * BISECT_TERMS: it can be bad/good or new/old.
> + * We read them and stock them to adapt the messages
> + * accordingly. Default is bad/good.
> + */
> +void read_bisect_terms(void)
> +{
> +       struct strbuf str = STRBUF_INIT;
> +       const char *filename = git_path("BISECT_TERMS");
> +       FILE *fp = fopen(filename, "r");
> +
> +       if (!fp) {
> +               bisect_bad = "bad";
> +               bisect_good = "good";
Ok, but...
Show 9 quoted lines
> +       } else {
> +       strbuf_getline(&str, fp, '\n');
> +       bisect_bad = strbuf_detach(&str, NULL);
> +       strbuf_getline(&str, fp, '\n');
> +       bisect_good = strbuf_detach(&str, NULL);
> +       }
> +       strbuf_release(&str);
> +       fclose(fp);
> +}
Show 6 quoted lines
> @@ -953,6 +991,8 @@ int bisect_next_all(const char *prefix, int no_checkout)
>               "(roughly %d step%s)\n", nr, (nr == 1 ? "" : "s"),
>               steps, (steps == 1 ? "" : "s"));
>
> +       free((char*)bisect_bad);
> +       free((char*)bisect_good);
...it is not a good thing to free these variables if they were not allocated.
Show 7 quoted lines
> +
>        return bisect_checkout(bisect_rev_hex, no_checkout);
>  }
>        case "$missing_good,$missing_bad,$1" in
>        ,,*)
> -               : have both good and bad - ok
> +               : have both good and bad or old and new - ok
Maybe ": have both $BISECT_GOOD and $BISECT_BAD - ok".

Thanks, Christian.

Previous: Junio C Hamano
Message 14 of 14 in “git bisect old/new”
  1. git bisect old/newValentin Duperray, Jun 12, 2012
  2. Christian CouderJun 12, 2012
  3. Junio C HamanoJun 12, 2012
  4. Phil HordJun 12, 2012
  5. Christian CouderJun 13, 2012
  6. Junio C HamanoJun 13, 2012
  7. [PATCHv2] git bisect old/newValentin Duperray, Jun 12, 2012
  8. Junio C HamanoJun 12, 2012
  9. duperrav@minatec.inpg.frJun 13, 2012
  10. Christian CouderJun 14, 2012
  11. Junio C HamanoJun 14, 2012
  12. Phil HordJun 15, 2012
  13. Junio C HamanoJun 15, 2012
  14. Christian CouderJun 13, 2012

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.