Re: [PATCH 2/2] apply: add --intent-to-add
- From
Junio C Hamano <gitster@pobox.com>
- Date
- May 21, 2018, 03:14 UTC
- Message-ID
- <xmqqa7st3dk4.fsf@gitster-ct.c.googlers.com>
- In-Reply-To
- <20180520063424.GA3062@duynguyen.home>
Duy Nguyen <pclouds@gmail.com> writes:
Show 11 quoted lines
>> > if (state->check_index && is_not_gitdir)
>> > return error(_("--index outside a repository"));
>> > + if (state->set_ita && is_not_gitdir)
>> > + state->set_ita = 0;
>>
>> I think this should error out, just like one line above does.
>> "I-t-a" is impossible without having the index, just like "--index"
>> is impossible without having the index.
>
> I was hoping to put this in an alias that works both with or without a
> repository. Do you feel strongly about this? "git apply --index" that silently applied only to the filesystem files without telling me that I am in a wrong directory by mistake is a UI disaster, and that is what the existing error we see in the pre context is about. I do not think of a good reason why "git apply --i-t-a" should behave any differently.