Re: [PATCH] checkout: disambiguate dwim tracking branches and local files

2018-11-12 Thread Junio C Hamano
Duy Nguyen writes: > Is it that different between an exact path name and a pathspec? > Suppose it is a pathspec (with wildcards) that matches some paths, and > we happen to have the remote branch origin/, then it is > still ambiguous whether we should go create branch > "" or go check out the

Re: [PATCH] checkout: disambiguate dwim tracking branches and local files

2018-11-12 Thread Duy Nguyen
On Mon, Nov 12, 2018 at 7:44 AM Junio C Hamano wrote: > > Nguyễn Thái Ngọc Duy writes: > > > @@ -1079,9 +1079,15 @@ static int parse_branchname_arg(int argc, const char > > **argv, > >*/ > > int recover_with_dwim = dwim_new_local_branch_ok; > > > > -

Re: [PATCH] checkout: disambiguate dwim tracking branches and local files

2018-11-11 Thread Junio C Hamano
Nguyễn Thái Ngọc Duy writes: > @@ -1079,9 +1079,15 @@ static int parse_branchname_arg(int argc, const char > **argv, >*/ > int recover_with_dwim = dwim_new_local_branch_ok; > > - if (!has_dash_dash && > - (check_filename(opts->prefix,

[PATCH] checkout: disambiguate dwim tracking branches and local files

2018-11-10 Thread Nguyễn Thái Ngọc Duy
When checkout dwim is added in [1], it is restricted to only dwim when certain conditions are met and fall back to default checkout behavior otherwise. It turns out falling back could be confusing. One of the conditions to turn git checkout frotz to git checkout -b frotz origin/frotz