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

2013-09-26 Thread Matthieu Moy
Jonathan Nieder writes: > case 3: git checkout [--] > > If is a commit, [...] > > If is _not_ a commit, either "--" is present or > is not a path, no -t nor -b was given, and [...] > > Otherwise, if "--" is present, treat it like case (1). > > Oth

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

2013-09-26 Thread Matthieu Moy
Jonathan Nieder writes: > Hi, > > Matthieu Moy wrote: > >> 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. > > Hm. I am not sure that was just an implementation side

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

2013-09-25 Thread Jonathan Nieder
Hi, Matthieu Moy wrote: > 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. Hm. I am not sure that was just an implementation side-effect. Normally 'git checkout --'

[PATCH v2 1/2] 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