Re: [PATCH 01/15] rebase: extend the options for handling of empty commits
- From
Elijah Newren <newren@gmail.com>
- Date
- Dec 21, 2019, 18:52 UTC
- Message-ID
- <CABPp-BHZ4nYaAN237w70cen=P0M3-TsWQz_+BeU_VtYEbRCbAQ@mail.gmail.com>
- In-Reply-To
- <CABPp-BF5MaO60GAXbqYPfEePKyn_K-B_hQXNvTN_L4S6iA_93w@mail.gmail.com>
On Fri, Dec 20, 2019 at 4:32 PM Elijah Newren <newren@gmail.com> wrote:
Show 5 quoted lines
> > On Fri, Dec 20, 2019 at 1:29 PM Junio C Hamano <gitster@pobox.com> wrote: > > > > "Elijah Newren via GitGitGadget" <gitgitgadget@gmail.com> writes: > >
Show 14 quoted lines
> > > +static long parse_empty_value(const char *value)
> > > +{
> > > + if (!value)
> > > + return EMPTY_UNSPECIFIED;
> > > + else if (!strcasecmp(value, "drop"))
> > > + return EMPTY_DROP;
> > > + else if (!strcasecmp(value, "keep"))
> > > + return EMPTY_KEEP;
> > > + else if (!strcasecmp(value, "ask"))
> > > + return EMPTY_ASK;
> >
> > Not an error but just silently ignored?
>
> Oops, I'll switch it to an error.By the way, diff.c's parse_algorithm_value() and diff_opt_diff_algorithm() behave the same way, where parse_algorithm_value() will return a negative value if it's not one of the valid known cases, and diff_opt_diff_algorithm() checks for negative and throws an error. Should I also modify those to put the error in parse_algorithm_value()? (Not part of this series, but as a consistency cleanup since it clearly surprised you and even I forgot that I had the calling function returning the error when I copied that style?)