Re: [PATCH 6/8] checkout: add --cached option
- From
Duy Nguyen <pclouds@gmail.com>
- Date
- Dec 10, 2018, 16:49 UTC
- Message-ID
- <CACsJy8CfgJ4NAnbMjBFGhRWscZxJCgxtx0QwSMw7MTjeMT4gDw@mail.gmail.com>
- In-Reply-To
- <20181209200449.16342-7-t.gummerer@gmail.com>
On Sun, Dec 9, 2018 at 9:05 PM Thomas Gummerer <t.gummerer@gmail.com> wrote:
> > Add a new --cached option to git checkout, which works only on the > index, but not the working tree, similar to what 'git reset <tree-ish> > -- <pathspec>... does.
Elijah wanted another mode (and I agree) that modifies worktree but leaves the index alone. This is most useful (or least confusing) when used with <tree-ish> and would be default in restore-files. I'm not saying you have to implement it, but how do the new command line options are designed to make sense?
I guess if --cached is "update index only" then --no-cached goes back to the default "update both worktree and index" and we need a another option for "worktree only"? Can we have one option with three possible values (index-only, index-and-worktree, worktree-only) maybe?
-- Duy