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.