Re: [PATCH 14/18] revert: Introduce --reset to remove sequencer state

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

 



Hi,

Jonathan Nieder writes:
> Ramkumar Ramachandra wrote:
>> Jonathan Nieder writes:
>>> Ramkumar Ramachandra wrote:
>
>>>> +     if (opts->subcommand == REPLAY_RESET) {
>>>> +             remove_sequencer_state(1);
>>>> +             return 0;
>>>> +     } else {
>>>> +             /* Start a new cherry-pick/ revert sequence */
>>>
>>> Can un-indent by dropping the "else":
>>
>> Actually this was intentional; if we un-indent this now, there'll be a
>> diff indenting it when '--reset' and '--continue' are introduced which
>> turns out to be especially ugly :)
>
> Why couldn't it look like this at the end, for example?  (As always,
> this is just an example; I am not saying "please make it look like
> this".)
>
>        if (opts->subcommand == REPLAY_RESET) {
>                remove_sequencer_state(1);
>                return 0;
>        }
>
>        if (opts->subcommand == REPLAY_CONTINUE) {
>                ... prepare todo list for continue ...
>        } else {
>                ... prepare todo list for a new cherry-pick ...
>        }
>        pick the chosen commits

Mainly style.  It looks a little unnatural: when more subcommands come
up, I'd like a nice switch-case to dispatch :)

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