From: Jeff King Date: Wed, 21 Jan 2009 19:12:19 GMT Subject: Re: Deleting remote branch pointed by remote HEAD Message-ID: <20090121191219.GD21686@coredump.intra.peff.net> In-Reply-To: On Wed, Jan 21, 2009 at 01:30:10PM -0500, Daniel Barkalow wrote: > The information is available already; the only thing is that we don't have > a way to know that the user wants to get the remote's suggested HEAD; as > Junio pointed out at the time, a user might decide that "next" is the most > interesting branch, and set refs/remotes/origin/HEAD to that branch, and > therefore doesn't want it reset to the remote server's value. > > That is, refs/remotes/origin/HEAD is only there to let the user abbreviate > the most useful branch of the remote; there's no reason it should reflect > the remote's HEAD, except that the remote's HEAD is a good guess if the > user hasn't said anything. Good point. It is probably wrong to just fetch it without asking, then. > I think it might be more appropriate to just care less about a broken > symref, explain what's wrong if the user actually tries to use it, and > otherwise mostly ignore it. I thought about that, but I still wonder if deleting it when the pointed-to ref is deleted might be more convenient. Remember that "refs/remotes/$foo/HEAD" can be accessed by a shorthand "$foo". So that means it can impact ref ambiguity lookup. I guess the chance of that happening is fairly unlikely, though. -Peff