Re: [PATCH 6/8] checkout: add --cached option
- From
Elijah Newren <newren@gmail.com>
- Date
- Feb 19, 2019, 23:00 UTC
- Message-ID
- <CABPp-BE19yVzDife5PqdQGmKrwrffoOt2KzBisgbqxaGry7LBw@mail.gmail.com>
- In-Reply-To
- <xmqqsgwjz9q1.fsf@gitster-ct.c.googlers.com>
On Tue, Feb 19, 2019 at 2:36 PM Junio C Hamano <gitster@pobox.com> wrote:
Show 22 quoted lines
> > Elijah Newren <newren@gmail.com> writes: > > >> As long as worktree-only mode does not lose track of a > >> previously-untracked path in the index (perhaps use the i-t-a bit), > >> I do not have a strong objection against making the worktree-only > >> mode the default. > > > > Could you unpack that for me a bit? > > Suppose in an ancient version v1.0 there was a file called > README.txt but these days such a file does not exist (there may be > README.md added though). By default, the command does not stuff the > contents to the index out of the tree and instead operate only on > the working tree. > > $ git restore-path --source v1.0 README.txt > > At this point, you are assuming that README.txt will become > untracked and the user needs to manually add it. I was asking if it > makes sense to at least make the index "aware of" it with I-T-A bit, > and I am leaning towards answering "yes" to that question.
Ah, thanks for all the clarifications (for this and the other emails). Your suggestion here would mean that --worktree alone wouldn't actually treat the index as read-only, but I too am leaning towards the thought that it makes sense to set the i-t-a bit for such cases.