Re: [PATCH 3/3] branch: forbid refs/heads/HEAD

2017-10-21 Thread Kaartic Sivaraam
On Sat, 2017-10-21 at 17:57 +0900, Junio C Hamano wrote: > ... The code may already > handle it, or there may need even more code to support the rename; I > didn't check. > As far as I could see there the code does seem to already handle the rename. This part of builtin/branch.c is what seems to

Re: [PATCH 3/3] branch: forbid refs/heads/HEAD

2017-10-21 Thread Junio C Hamano
Kaartic Sivaraam writes: >> The only difference is improved tests where we use show-ref to make >> sure refs/heads/HEAD does not exist when it shouldn't, exercise >> update-ref to create and delete refs/heads/HEAD, and also make sure >> it can be deleted with "git

Re: [PATCH 3/3] branch: forbid refs/heads/HEAD

2017-10-20 Thread Kaartic Sivaraam
Junio C Hamano writes: > > > Perhaps. Also we may want to make sure that "git branch -D HEAD" > > still works as a way to recover from historical mistakes. > > The only difference is improved tests where we use show-ref to make > sure refs/heads/HEAD does not exist when it

Re: [PATCH 3/3] branch: forbid refs/heads/HEAD

2017-10-16 Thread Jeff King
On Sat, Oct 14, 2017 at 11:20:11AM +0900, Junio C Hamano wrote: > Junio C Hamano writes: > > >> Should we test that: > >> > >> git update-ref refs/heads/HEAD HEAD^ > >> > >> continues to work? > > > > Perhaps. Also we may want to make sure that "git branch -D HEAD" > >

Re: [PATCH 3/3] branch: forbid refs/heads/HEAD

2017-10-13 Thread Junio C Hamano
Junio C Hamano writes: >> Should we test that: >> >> git update-ref refs/heads/HEAD HEAD^ >> >> continues to work? > > Perhaps. Also we may want to make sure that "git branch -D HEAD" > still works as a way to recover from historical mistakes. The only difference is

Re: [PATCH 3/3] branch: forbid refs/heads/HEAD

2017-10-13 Thread Junio C Hamano
Jeff King writes: > On Fri, Oct 13, 2017 at 02:11:32PM +0900, Junio C Hamano wrote: > >> strbuf_check_branch_ref() is the central place where many codepaths >> see if a proposed name is suitable for the name of a branch. It was >> designed to allow us to get stricter than the

Re: [PATCH 3/3] branch: forbid refs/heads/HEAD

2017-10-13 Thread Jeff King
On Fri, Oct 13, 2017 at 02:11:32PM +0900, Junio C Hamano wrote: > strbuf_check_branch_ref() is the central place where many codepaths > see if a proposed name is suitable for the name of a branch. It was > designed to allow us to get stricter than the check_refname_format() > check used for