Re: [PATCH 6/8] checkout: add --cached option
- From
Elijah Newren <newren@gmail.com>
- Date
- Feb 19, 2019, 22:04 UTC
- Message-ID
- <CABPp-BERuEtdjHhqaao+2=rsLXiPdkG4SbeULQ6=59hgWS5BLg@mail.gmail.com>
- In-Reply-To
- <xmqqo9771tnj.fsf@gitster-ct.c.googlers.com>
On Tue, Feb 19, 2019 at 11:10 AM Junio C Hamano <gitster@pobox.com> wrote:
Show 11 quoted lines
> > Junio C Hamano <gitster@pobox.com> writes: > > > I am getting the impression that to save typing, you would want to > > make "--index --worktree" the default (i.e. among the above, only > > --no-index and --no-worktree need to be spelled explicitly), but > > there is one glitch. Updating from the index must be spelled > > explicitly with "--no-index --worktree". > > And after getting reminded by Elijah, the default pair is > <--no-index, --worktree>.
Why would you want --no-index or --no-worktree as flags? That seems to presume a default of modifying both the index and the working tree, as these names imply undoing pieces of such a default.
I'd rather have a flag like --worktree which alone only modifies the working tree and is presumed to be the default (but useful to be explicit or as mentioned later), have a flag for applying the changes to the index instead (--index?), and treat applying to both the working tree and the index as unusual and require either both flags (--worktree --index ?) or some special flag that likely has a longer name (--worktree-and-index?).
I _think_ Duy does the latter reading over his manpage that he linked to, but maybe I'm just reading my own biases into it.