From: Junio C Hamano Date: Tue, 15 Nov 2005 18:13:15 GMT Subject: Re: [PATCH] Disable USE_SYMLINK_HEAD by default Message-ID: <7v4q6dn5j8.fsf@assigned-by-dhcp.cox.net> In-Reply-To: <1132075295.25640.59.camel@dv> Pavel Roskin writes: > On Tue, 2005-11-15 at 09:05 -0800, Junio C Hamano wrote: >> Petr Baudis writes: >> >> > Yes, I would very much like to have this. I still want to go >> > symrefs-only for public repositories created for cg-admin-setuprepo, so >> > that fetching over HTTP works properly. >> >> Sorry, I must have missed that part. How does fetch-over-HTTP >> break with symlinked HEAD? > > With symlinks, cogito doesn't know which branch it is fetching if the > branch is not explicitly specified. Ah, thanks. git-clone-pack has the same problem. It basically "guesses" by: - If the master branch exists, and the object name of the branch tip matches the object name of HEAD, assume HEAD points at master. Even when there are other branches that happen to share the same branch head. - Otherwise, if there is a branch whose tip matches the object name of HEAD, assume HEAD points at it. It just picks "one-of-them" if more than one branches match. - If there is no branch that matches HEAD, issue a warning and create HEAD that records the object name, not pointing anywhere. To solve this generally we would need to extend what ls-remote returns, I suppose.