Re: [PATCH 6/8] checkout: add --cached option
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Feb 19, 2019, 19:10 UTC
- Message-ID
- <xmqqo9771tnj.fsf@gitster-ct.c.googlers.com>
- In-Reply-To
- <xmqqwolv1tzw.fsf@gitster-ct.c.googlers.com>
Junio C Hamano <gitster@pobox.com> writes:
Show 5 quoted lines
> 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>.
Show 9 quoted lines
> So perhaps the defaulting rule for the "--index" option must become > a bit more tricky. Perhaps the rules are: > > * --worktree is the default; --no-worktree can be given from the > command line to countermand it, and --worktree can be given from > the command line to be more explicit. > > * when --source <tree> is given from the command line, --index is > the default, and --no-index can be given to countermand it.
Correction.
* when --source <tree> is given, --no-index is the default, but
--index can be given to countermand it.Show 7 quoted lines
> > * when --source <tree> is not given from the command line, > --no-index is the only sensible choice. It can be given from the > command line to be more explicit, but giving --index to > countermand the --no-index default would be an error, as updating > the index, whether the same update also goes to the working tree, > must come from a --source <tree>.
This is still correct.