Re: [PATCH 01/15] rebase: extend the options for handling of empty commits

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

 



Elijah Newren <newren@xxxxxxxxx> writes:

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

Not necessarily (see "Ahh, OK" below).

>> > +     return EMPTY_UNSPECIFIED;
>> > +}
>> > +
>>
>> > +static int parse_opt_empty(const struct option *opt, const char *arg, int unset)
>> > +{
>> > +     struct rebase_options *options = opt->value;
>> > +     long value = parse_empty_value(arg);
>>
>> Ahh, OK.
>>
>> Wouldn't it be better to make the variable and the parsing helper
>> function of type "enum empty_type", not "long", just like the field
>> in the rebase_options struct?
>
> Indeed, I'll fix this up.

Thanks. I was wondering if there is something subtle I didn't see
going on around here.



[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]

  Powered by Linux