Re: [PATCH v2] bisect--helper: convert a function in shell to C
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Mar 23, 2016, 11:23 UTC
- Message-ID
- <alpine.DEB.2.20.1603231223090.4690@virtualbox>
- In-Reply-To
- <CAFZEwPOV1oE=5uyyooM1kYKxbuY0Jn=ccxYwsc5sxi0e9cgS6A@mail.gmail.com>
Hi Pranit,
On Tue, 22 Mar 2016, Pranit Bauva wrote:
Show 32 quoted lines
> On Tue, Mar 22, 2016 at 8:41 PM, Johannes Schindelin
> <Johannes.Schindelin@gmx.de> wrote:
> >
> > On Tue, 22 Mar 2016, Johannes Schindelin wrote:
> >
> >> On Tue, 22 Mar 2016, Pranit Bauva wrote:
> >>
> >> > + if (!strcmp(term, "bad") || !strcmp(term, "new"))
> >> > + if(strcmp(revision, "bad"))
> >> > + die("can't change the meaning of term '%s'", term);
> >> > +
> >> > + if (!strcmp(term, "good") || !strcmp(term, "old"))
> >> > + if (strcmp(revision, "good"))
> >> > + die("can't change the meaning of term '%s'", term);
> >>
> >> These two can be combined. Actually, these *four* can easily be combined:
> >>
> >> if ((one_of(term, "bad", "new", NULL) && strcmp(orig, "bad")) ||
> >> (one_of(term, "good", "old", NULL) && strcmp(orig, "good")))
> >> die("can't change the meaning of term '%s'", term);
> >
> > Completely forgot to mention: This conversion skipped the comment
> >
> > # In theory, nothing prevents swapping
> > # completely good and bad, but this situation
> > # could be confusing and hasn't been tested
> > # enough. Forbid it for now.
> >
> > Let's port that comment over, too?
>
> Sure! Adding a comment won't harm anyone. We can remove it when its
> thoroughly tested.I am actually not so eager to remove the comment...
Ciao, Johannes