Re: [PATCH 6/8] checkout: add --cached option

2019-02-19 Thread Duy Nguyen
On Wed, Feb 20, 2019 at 5:05 AM Elijah Newren wrote: > > On Tue, Feb 19, 2019 at 11:10 AM Junio C Hamano wrote: > > > > Junio C Hamano 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 > >

Re: [PATCH 6/8] checkout: add --cached option

2019-02-19 Thread Duy Nguyen
On Wed, Feb 20, 2019 at 5:29 AM Junio C Hamano wrote: > > Elijah Newren writes: > > > On Tue, Feb 19, 2019 at 11:10 AM Junio C Hamano wrote: > >> > >> Junio C Hamano writes: > >> > >> > I am getting the impression that to save typing, you would want to > >> > make "--index --worktree" the defau

Re: [PATCH 6/8] checkout: add --cached option

2019-02-19 Thread Duy Nguyen
On Wed, Feb 20, 2019 at 2:10 AM Junio C Hamano wrote: > > Junio C Hamano 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 > >

Re: [PATCH 6/8] checkout: add --cached option

2019-02-19 Thread Duy Nguyen
On Wed, Feb 20, 2019 at 5:36 AM Junio C Hamano wrote: > > Elijah Newren 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 t

Re: [PATCH 6/8] checkout: add --cached option

2019-02-19 Thread Elijah Newren
On Tue, Feb 19, 2019 at 2:36 PM Junio C Hamano wrote: > > Elijah Newren 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 t

Re: [PATCH 6/8] checkout: add --cached option

2019-02-19 Thread Junio C Hamano
Elijah Newren 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 a

Re: [PATCH 6/8] checkout: add --cached option

2019-02-19 Thread Junio C Hamano
Elijah Newren writes: > On Tue, Feb 19, 2019 at 11:03 AM Junio C Hamano wrote: >> * --no-index --worktree ... >> >>Update only the working tree files without touching the index >>(new feature that cannot be done with the current Git, although >>"cat-file -p >path" may be close enoug

Re: [PATCH 6/8] checkout: add --cached option

2019-02-19 Thread Junio C Hamano
Elijah Newren writes: > On Tue, Feb 19, 2019 at 11:10 AM Junio C Hamano wrote: >> >> Junio C Hamano 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

Re: [PATCH 6/8] checkout: add --cached option

2019-02-19 Thread Elijah Newren
On Tue, Feb 19, 2019 at 11:07 AM Junio C Hamano wrote: > > Elijah Newren writes: > > > Overall this looks good, but there's just one part that confuses me. > > Here you seem to suggest that if you pass --source but neither --index > > or --worktree that both the index and working tree will be wri

Re: [PATCH 6/8] checkout: add --cached option

2019-02-19 Thread Elijah Newren
On Tue, Feb 19, 2019 at 11:03 AM Junio C Hamano wrote: > * --no-index --worktree ... > >Update only the working tree files without touching the index >(new feature that cannot be done with the current Git, although >"cat-file -p >path" may be close enough at times), from the index I

Re: [PATCH 6/8] checkout: add --cached option

2019-02-19 Thread Elijah Newren
On Tue, Feb 19, 2019 at 11:10 AM Junio C Hamano wrote: > > Junio C Hamano 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 > >

Re: [PATCH 6/8] checkout: add --cached option

2019-02-19 Thread Junio C Hamano
Junio C Hamano 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 > expl

Re: [PATCH 6/8] checkout: add --cached option

2019-02-19 Thread Junio C Hamano
Elijah Newren writes: > Overall this looks good, but there's just one part that confuses me. > Here you seem to suggest that if you pass --source but neither --index > or --worktree that both the index and working tree will be written to. > Why are "restored" changes considered ready for commit?

Re: [PATCH 6/8] checkout: add --cached option

2019-02-19 Thread Junio C Hamano
Duy Nguyen writes: > On Sat, Feb 2, 2019 at 12:57 AM Junio C Hamano wrote: >> >> Duy Nguyen writes: >> >> > Of course we could just do --index and --worktree, each option >> > restores the respective part. Then it's combinable (and extensible in >> > the future). But then "git restore" means "g

Re: [PATCH 6/8] checkout: add --cached option

2019-02-19 Thread Duy Nguyen
On Tue, Feb 19, 2019 at 9:42 PM Elijah Newren wrote: > > OK this hopefully will be the final design > > > > (git restore) "[--worktree] " restores worktree paths from index > > > > "--index " restores the index from HEAD (aka "git reset") > > > > "--source (--index|--worktree) " restores index or

Re: [PATCH 6/8] checkout: add --cached option

2019-02-19 Thread Elijah Newren
Hi Duy, On Mon, Feb 18, 2019 at 8:21 PM Duy Nguyen wrote: > > On Sat, Feb 2, 2019 at 12:57 AM Junio C Hamano wrote: > > > > Duy Nguyen writes: > > > > > Of course we could just do --index and --worktree, each option > > > restores the respective part. Then it's combinable (and extensible in > >

Re: [PATCH 6/8] checkout: add --cached option

2019-02-18 Thread Duy Nguyen
On Sat, Feb 2, 2019 at 12:57 AM Junio C Hamano wrote: > > Duy Nguyen writes: > > > Of course we could just do --index and --worktree, each option > > restores the respective part. Then it's combinable (and extensible in > > the future). But then "git restore" means "git restore --index > > --work

Re: [PATCH 6/8] checkout: add --cached option

2019-02-02 Thread Duy Nguyen
On Sat, Feb 2, 2019 at 12:57 AM Junio C Hamano wrote: > > Duy Nguyen writes: > > > Of course we could just do --index and --worktree, each option > > restores the respective part. Then it's combinable (and extensible in > > the future). But then "git restore" means "git restore --index > > --work

Re: [PATCH 6/8] checkout: add --cached option

2019-02-01 Thread Junio C Hamano
Duy Nguyen writes: > Of course we could just do --index and --worktree, each option > restores the respective part. Then it's combinable (and extensible in > the future). But then "git restore" means "git restore --index > --worktree" and typing "git restore --index" effectively removes the > def

Re: [PATCH 6/8] checkout: add --cached option

2019-01-31 Thread Duy Nguyen
On Fri, Feb 1, 2019 at 2:05 AM Junio C Hamano wrote: > > Duy Nguyen writes: > > > I've changed my mind. I'm not using --index and --cached for "git > > restore" (formerly "git restore-files"). So how about this? > > > > git restore --from= will update both the index and > > worktree. > > > > gi

Re: [PATCH 6/8] checkout: add --cached option

2019-01-31 Thread Junio C Hamano
Duy Nguyen writes: > I've changed my mind. I'm not using --index and --cached for "git > restore" (formerly "git restore-files"). So how about this? > > git restore --from= will update both the index and worktree. > > git restore --from= --keep-index will not update the index > > git restore --

Re: [PATCH 6/8] checkout: add --cached option

2019-01-30 Thread Duy Nguyen
On Wed, Dec 12, 2018 at 2:23 AM Duy Nguyen wrote: > > On Tue, Dec 11, 2018 at 7:12 AM Elijah Newren wrote: > > > > On Mon, Dec 10, 2018 at 7:13 PM Junio C Hamano wrote: > > > > > > Duy Nguyen writes: > > > > > > > Elijah wanted another mode (and I agree) that modifies worktree but > > > > leave

Re: [PATCH 6/8] checkout: add --cached option

2018-12-11 Thread Thomas Gummerer
On 12/10, Elijah Newren wrote: > On Sun, Dec 9, 2018 at 12:05 PM Thomas Gummerer 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 > > -- ... does. Indeed the tests are adapted from the 'git > > reset

Re: [PATCH 6/8] checkout: add --cached option

2018-12-11 Thread Duy Nguyen
On Tue, Dec 11, 2018 at 7:12 AM Elijah Newren wrote: > > On Mon, Dec 10, 2018 at 7:13 PM Junio C Hamano wrote: > > > > Duy Nguyen writes: > > > > > Elijah wanted another mode (and I agree) that modifies worktree but > > > leaves the index alone. This is most useful (or least confusing) when > >

Re: [PATCH 6/8] checkout: add --cached option

2018-12-10 Thread Elijah Newren
On Mon, Dec 10, 2018 at 7:13 PM Junio C Hamano wrote: > > Duy Nguyen writes: > > > 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 and would be default in restore-files. I'm not > > saying

Re: [PATCH 6/8] checkout: add --cached option

2018-12-10 Thread Junio C Hamano
Duy Nguyen writes: > 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 and would be default in restore-files. I'm not > saying you have to implement it, but how do the new command line > options

Re: [PATCH 6/8] checkout: add --cached option

2018-12-10 Thread Elijah Newren
On Sun, Dec 9, 2018 at 12:05 PM Thomas Gummerer 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 > -- ... does. Indeed the tests are adapted from the 'git > reset' tests. > > In the longer term the idea is

Re: [PATCH 6/8] checkout: add --cached option

2018-12-10 Thread Duy Nguyen
On Sun, Dec 9, 2018 at 9:05 PM Thomas Gummerer 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 > -- ... does. Elijah wanted another mode (and I agree) that modifies worktree but leaves the index alone. Th

[PATCH 6/8] checkout: add --cached option

2018-12-09 Thread Thomas Gummerer
Add a new --cached option to git checkout, which works only on the index, but not the working tree, similar to what 'git reset -- ... does. Indeed the tests are adapted from the 'git reset' tests. In the longer term the idea is to potentially deprecate 'git reset -- ...', so the 'git reset' com