[RFC/PATCH] checkout: allow dwim for branch creation for "git checkout $branch --"

2013-09-25 Thread Matthieu Moy
The "--" notation disambiguates files and branches, but as a side-effect of the previous implementation, also disabled the branch auto-creation when $branch does not exist. A possible scenario is then: git checkout $branch => fails if $branch is both a ref and a file, and suggests -- git checkou

Re: [RFC/PATCH] checkout: allow dwim for branch creation for "git checkout $branch --"

2013-09-25 Thread Duy Nguyen
On Wed, Sep 25, 2013 at 7:49 PM, Matthieu Moy wrote: > static int parse_branchname_arg(int argc, const char **argv, > int dwim_new_local_branch_ok, > struct branch_info *new, You may want to update the big comment block about all ca

Re: [RFC/PATCH] checkout: allow dwim for branch creation for "git checkout $branch --"

2013-09-25 Thread Matthieu Moy
Duy Nguyen writes: > has_dash_dash is calculated as (argc > 1) && !strcmp(argv[1], "--"), > so when argc == 1, the has_dash_dash must be zero, the "&& > !has_dash_dash" is redundant. Yes, but I'd rather not have to read the detailed definition of has_dash_dash to understand the code. With my ver

Re: [RFC/PATCH] checkout: allow dwim for branch creation for "git checkout $branch --"

2013-09-25 Thread Duy Nguyen
On Wed, Sep 25, 2013 at 8:52 PM, Matthieu Moy wrote: > @@ -925,7 +926,15 @@ static int parse_branchname_arg(int argc, const char > **argv, > return 1; > > arg = argv[0]; > - has_dash_dash = (argc > 1) && !strcmp(argv[1], "--"); > + has_dash_dash = 0; > +

Re: [RFC/PATCH] checkout: allow dwim for branch creation for "git checkout $branch --"

2013-10-16 Thread Junio C Hamano
Matthieu Moy writes: > Duy Nguyen writes: > >> has_dash_dash is calculated as (argc > 1) && !strcmp(argv[1], "--"), >> so when argc == 1, the has_dash_dash must be zero, the "&& >> !has_dash_dash" is redundant. > > Yes, but I'd rather not have to read the detailed definition of > has_dash_dash t

Re: [RFC/PATCH] checkout: allow dwim for branch creation for "git checkout $branch --"

2013-10-17 Thread Matthieu Moy
Junio C Hamano writes: > Did anything further happen to this discussion? Is v3 the version > with agreement among the list members I just should pick up? v3 ( http://thread.gmane.org/gmane.comp.version-control.git/235409/focus=235408 ) is the last version I sent, and I got no feedback on it, so

Re: [RFC/PATCH] checkout: allow dwim for branch creation for "git checkout $branch --"

2013-10-17 Thread Junio C Hamano
Matthieu Moy writes: > v3 > ( http://thread.gmane.org/gmane.comp.version-control.git/235409/focus=235408 ) > is the last version I sent, and I got no feedback on it, so I guess it's > ready for you to pick. Thanks; done with s/pick/nitpick/ ;-). -- To unsubscribe from this list: send the line "u