Re: [PATCH] t6300: avoid creating refs/heads/HEAD

2017-02-27 Thread Jeff King
On Mon, Feb 27, 2017 at 01:44:26PM -0800, Junio C Hamano wrote: > Junio C Hamano writes: > > > ... I suspect that calling interpret_empty_at() from > > that function is fundamentally flawed. The "@" end user types never > > means refs/heads/HEAD, and HEAD@{either reflog or -1} would not mean >

Re: [PATCH] t6300: avoid creating refs/heads/HEAD

2017-02-27 Thread Junio C Hamano
Jeff King writes: > The "other" stuff could sometimes be useful, I guess. It's not _always_ > wrong to do: > > git branch -f @{upstream} foo > > It depends on what your @{upstream} resolves to. Switching to just using > interpret_nth_prior_checkout() would break the case when it resolves to > a

Re: [PATCH] t6300: avoid creating refs/heads/HEAD

2017-02-27 Thread Junio C Hamano
Junio C Hamano writes: > ... I suspect that calling interpret_empty_at() from > that function is fundamentally flawed. The "@" end user types never > means refs/heads/HEAD, and HEAD@{either reflog or -1} would not mean > anything that should be taken as a branch_name, either. The latter shou

Re: [PATCH] t6300: avoid creating refs/heads/HEAD

2017-02-27 Thread Jeff King
On Mon, Feb 27, 2017 at 01:19:29PM -0800, Junio C Hamano wrote: > Jeff King writes: > > > I suspect there are a lot of other places that are less clear cut. E.g., > > I think just: > > > > git branch foo bar > > > > will put "foo" through the same interpretation. So you could do: > > > > git

Re: [PATCH] t6300: avoid creating refs/heads/HEAD

2017-02-27 Thread Junio C Hamano
Jeff King writes: > I suspect there are a lot of other places that are less clear cut. E.g., > I think just: > > git branch foo bar > > will put "foo" through the same interpretation. So you could do: > > git branch -f @{-1} bar > > Is that insane? Maybe. But it does work now. No, it _is_ ve

Re: [PATCH] t6300: avoid creating refs/heads/HEAD

2017-02-27 Thread Jeff King
On Mon, Feb 27, 2017 at 11:33:23AM -0800, Junio C Hamano wrote: > Jeff King writes: > > > This comes originally from Junio's 84679d470. I cannot see how naming > > the new branch HEAD would make any difference to the test, but perhaps I > > am missing something. > > Nah, I think it was just a r

Re: [PATCH] t6300: avoid creating refs/heads/HEAD

2017-02-27 Thread Junio C Hamano
Jeff King writes: > This comes originally from Junio's 84679d470. I cannot see how naming > the new branch HEAD would make any difference to the test, but perhaps I > am missing something. Nah, I think it was just a random string that came to mind and the topic being "ah we blindly dereference s

[PATCH] t6300: avoid creating refs/heads/HEAD

2017-02-27 Thread Jeff King
In one test, we use "git checkout --orphan HEAD" to create an unborn branch. Confusingly, the resulting branch is named "refs/heads/HEAD". The original probably meant something like: git checkout --orphan orphaned-branch HEAD Let's just use "orphaned-branch" here to make this less confusing. Pu