Re: [PATCH 1/3] reset: add --stage and --work options
- From
Felipe Contreras <felipe.contreras@gmail.com>
- Date
- Sep 8, 2013, 22:55 UTC
- Message-ID
- <CAMP44s01CqJoDupmiD4K85Y1p9jF0PrT3v5owrS5WQkKQ-kkXA@mail.gmail.com>
- In-Reply-To
- <CALkWK0=P0xZAk95Jmw9mRUCwPQP7NmVHsuPaWNg+D2v3wP9=-w@mail.gmail.com>
On Sun, Sep 8, 2013 at 5:05 PM, Ramkumar Ramachandra <artagnon@gmail.com> wrote:
Show 28 quoted lines
> Felipe Contreras wrote:
>>
>> @@ -290,6 +294,22 @@ int cmd_reset(int argc, const char **argv, const char
>> *prefix)
>> hashcpy(sha1, tree->object.sha1);
>> }
>>
>> + if (stage >= 0 || working_tree >= 0) {
>> + if (reset_type != NONE)
>> + die(_("--{stage,work} are incompatible with
>> --{hard,mixed,soft,merge}"));
>> +
>> + if (working_tree == 1) {
>> + if (stage == 0)
>> + die(_("--no-stage doesn't make sense with
>> --work"));
>> + reset_type = HARD;
>> + } else {
>> + if (stage == 1)
>> + reset_type = NONE;
>> + else
>> + reset_type = SOFT;
>> + }
>> + }
>> +
>
>
> Not making sense at this point. Why does --stage set a reset_type?Yeah, we would need another patch to cleanup the variable names, but for now it's better to minimize the changes.
Either way it doesn't matter because Junio is determined to stand alone versus the rest of the world in this issue.
-- Felipe Contreras