From: Martin von Zweigbergk Date: Fri, 18 Feb 2011 02:08:14 GMT Subject: Re: [1.8.0] Summary of the discussions Message-ID: In-Reply-To: <7vwrky5f48.fsf@alter.siamese.dyndns.org> On Thu, 17 Feb 2011, Junio C Hamano wrote: > * "git checkout refs/heads/" checks out branch. > > From: Martin von Zweigbergk > Date: Mon, 7 Feb 2011 06:01:51 -0500 (EST) > Message-ID: > > -- summary -- > > In addition to "git checkout " that names an existing branch, > special case "git checkout refs/heads/" to check the branch out, At first I was going to say that I don't think special casing it should be necessary. It seemed like as long as the name resolves to something like refs/heads/, the branch should be checked out. Then I think I realized why you said to special case it. Since checkout favors branches to tags, we would first have to check if refs/heads/ is valid and if it is not, check if the argument resolves to refs/heads/ (maybe ignoring tags called "heads/"). > instead of detaching HEAD at the tip of the branch. If you want to > detach at a specific commit and wanted to disambiguate that is > both a branch and another ref by checking out refs/heads/, your > workflow will be broken by this change, but you can still say > refs/heads/^0 to work it around. > > -- comments -- > > I do not think this backward incompatible breakage would seriously > hurt in practice, and if people see newbies are hurt by getting a > detached HEAD when they check out refs/heads/, this proposal > might be an improvement, but I have a feeling that this may be trying > to solve a wrong problem. > > Why are these people _tempted_ to type refs/heads/ explicitly? It > could be our tutorial or documentation. That might be the thing to > fix. It wasn't until recently that I learned that "git checkout [refs/]heads/" (and rebase [refs/]heads/name) detaches the head, so it wasn't really to try to help newbies that I proposed changing it. It was just that the current behavior is not what I think most people would expect. /Martin