Re: [PATCH v2 6/7] checkout: split into switch-branch and checkout-files

2018-11-29 Thread Stefan Xenos
> > Which brings us back to your "git checkout-files " use case > above. It should be treat the same way in my opinion, so we either do > > git checkout-files --from=tree-ish :/ > > or > > git checkout-files --from=tree-ish . > > But "git checkout-files --from=tree-ish" alone is rejected.

Re: [PATCH v2 6/7] checkout: split into switch-branch and checkout-files

2018-11-29 Thread Duy Nguyen
On Thu, Nov 29, 2018 at 7:14 PM Stefan Beller wrote: > > > > Idea: > > > If git checkout-files modifies the submodules file, it could also > > > auto-update the submodules. (For example, with something like "git > > > submodule update --init --recursive --progress"). > > > > This one is tricky

Re: [PATCH v2 6/7] checkout: split into switch-branch and checkout-files

2018-11-29 Thread Stefan Beller
> > Idea: > > If git checkout-files modifies the submodules file, it could also > > auto-update the submodules. (For example, with something like "git > > submodule update --init --recursive --progress"). > > This one is tricky because we should deal with submodule autoupdate > consistently across

Re: [PATCH v2 6/7] checkout: split into switch-branch and checkout-files

2018-11-29 Thread Duy Nguyen
On Thu, Nov 29, 2018 at 12:22 AM Stefan Xenos wrote: > Some behaviors I'd expect to see from these commands (I haven't yet > checked to see if you've already done this): > > git checkout-files > should reset all the files in the repository regardless of the current > directory - it should

Re: [PATCH v2 6/7] checkout: split into switch-branch and checkout-files

2018-11-29 Thread Duy Nguyen
On Thu, Nov 29, 2018 at 6:59 AM Junio C Hamano wrote: > > Stefan Xenos writes: > > > Although I have no problem with "switch-branch" as a command name, > > some alternative names we might consider for switch-branch might be: > > > > chbranch > > swbranch > > Please never go in that direction.

Re: [PATCH v2 6/7] checkout: split into switch-branch and checkout-files

2018-11-28 Thread Junio C Hamano
Stefan Xenos writes: > Although I have no problem with "switch-branch" as a command name, > some alternative names we might consider for switch-branch might be: > > chbranch > swbranch Please never go in that direction. So far, we made a conscious effort to keep the names of most frequently

Re: [PATCH v2 6/7] checkout: split into switch-branch and checkout-files

2018-11-28 Thread Junio C Hamano
Stefan Beller writes: > I dislike the checkout-* names, as we already have checkout-index > as plumbing, so it would be confusing as to which checkout-* command > should be used when and why as it seems the co-index moves > content *from index* to the working tree, but the co-files moves content

Re: [PATCH v2 6/7] checkout: split into switch-branch and checkout-files

2018-11-28 Thread Stefan Xenos
More thoughts: git switch-branch should never detach HEAD unless asked to do so explicitly. That also means that "git switch-branch" shouldn't accept any of the non-branch tree-ish arguments that would have caused "git checkout" to do so. On Wed, Nov 28, 2018 at 3:26 PM Stefan Xenos wrote: > >

Re: [PATCH v2 6/7] checkout: split into switch-branch and checkout-files

2018-11-28 Thread Stefan Xenos
Although I have no problem with "switch-branch" as a command name, some alternative names we might consider for switch-branch might be: chbranch swbranch switch branch change (as a subcommand for the "branch" command) I've personally been using "chbranch" as an alias for this functionality for

Re: [PATCH v2 6/7] checkout: split into switch-branch and checkout-files

2018-11-28 Thread Stefan Xenos
> Since the other one is already "checkout-files", maybe this one could just be > "checkout-branch". I rather like switch-branch and dislike the word "checkout" since it has been overloaded in git for so long (does it mean moving HEAD or copying files to my working tree?) > nobody will become

Re: [PATCH v2 6/7] checkout: split into switch-branch and checkout-files

2018-11-28 Thread Duy Nguyen
On Wed, Nov 28, 2018 at 8:08 PM Stefan Beller wrote: > > On Wed, Nov 28, 2018 at 7:31 AM Duy Nguyen wrote: > > > > On Wed, Nov 28, 2018 at 7:03 AM Junio C Hamano wrote: > > > > > > Nguyễn Thái Ngọc Duy writes: > > > > > > > The good old "git checkout" command is still here and will be until >

Re: [PATCH v2 6/7] checkout: split into switch-branch and checkout-files

2018-11-28 Thread Stefan Beller
On Wed, Nov 28, 2018 at 7:31 AM Duy Nguyen wrote: > > On Wed, Nov 28, 2018 at 7:03 AM Junio C Hamano wrote: > > > > Nguyễn Thái Ngọc Duy writes: > > > > > The good old "git checkout" command is still here and will be until > > > all (or most of users) are sick of it. > > > > Two comments on

Re: [PATCH v2 6/7] checkout: split into switch-branch and checkout-files

2018-11-28 Thread Duy Nguyen
On Wed, Nov 28, 2018 at 7:03 AM Junio C Hamano wrote: > > Nguyễn Thái Ngọc Duy writes: > > > The good old "git checkout" command is still here and will be until > > all (or most of users) are sick of it. > > Two comments on the goal (the implementation looked reasonable > assuming the reader

Re: [PATCH v2 6/7] checkout: split into switch-branch and checkout-files

2018-11-27 Thread Junio C Hamano
Nguyễn Thái Ngọc Duy writes: > The good old "git checkout" command is still here and will be until > all (or most of users) are sick of it. Two comments on the goal (the implementation looked reasonable assuming the reader agrees with the gaol). At least to me, the verb "switch" needs two

[PATCH v2 6/7] checkout: split into switch-branch and checkout-files

2018-11-27 Thread Nguyễn Thái Ngọc Duy
"git checkout" doing too many things is a source of confusion for many users (and it even bites old timers sometimes). To rememdy that, the command is now split in two: switch-branch and checkout-files. The switch-branch command is all about switching branches, detaching, DWIM-ing new branch...