Re: [PATCHv2] git bisect old/new

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Jun 13, 2012 at 12:56 AM, Valentin Duperray
<Valentin.Duperray@xxxxxxxxxxxxxxx> wrote:
>
> 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!

>  /*
> + * 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...

> +       } 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);
> +}


> @@ -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.

> +
>        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.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]