git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Deleting remote branch pointed by remote HEAD

From
Daniel Barkalow <barkalow@iabervon.org>
Date
Jan 21, 2009, 19:50 UTC
Message-ID
<alpine.LNX.1.00.0901211443140.19665@iabervon.org>
In-Reply-To
<20090121191408.GA22958@coredump.intra.peff.net>
On Wed, 21 Jan 2009, Jeff King wrote:
Show 17 quoted lines
> On Wed, Jan 21, 2009 at 02:12:19PM -0500, Jeff King wrote:
> 
> > > 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.
> 
> Not to mention that even without others refs with matching names, it is
> probably nicer to the user who does try to access it via "$foo" to
> simply say "there is no $foo" rather than a confusing error message
> about a deleted branch that they have to manually fix. And that is
> easily accomplished by deleting such a bogus symref.

I think the ideal thing is to keep the symref as a reminder and just give a non-confusing error message instead of a confusing one. E.g.:

""" $foo is set to mean the tracking branch $foo/bar, which does not exist. Use:

  git remote set-default $foo <name>

to set a new default branch for $foo. """

(And, of course, add that subcommand to remote)
	-Daniel
*This .sig left intentionally blank*
Previous: Jeff KingNext: Jeff King
Message 11 of 24 in “Deleting remote branch pointed by remote HEAD”
  1. Marc-André LureauJan 21, 2009
  2. Michael J GruberJan 21, 2009
  3. Marc-André LureauJan 21, 2009
  4. Michael J GruberJan 21, 2009
  5. Marc-André LureauJan 21, 2009
  6. Jeff KingJan 21, 2009
  7. Daniel BarkalowJan 21, 2009
  8. Boyd Stephen Smith Jr.Jan 21, 2009
  9. Jeff KingJan 21, 2009
  10. Jeff KingJan 21, 2009
  11. Daniel BarkalowJan 21, 2009
  12. Jeff KingJan 21, 2009
  13. Felipe ContrerasMar 12, 2009
  14. Jeff KingMar 12, 2009
  15. Felipe ContrerasMar 12, 2009
  16. Jeff KingMar 12, 2009
  17. Junio C HamanoJan 21, 2009
  18. Felipe ContrerasJan 21, 2009
  19. Jeff KingJan 21, 2009
  20. Felipe ContrerasJan 21, 2009
  21. Adeodato SimóJan 21, 2009
  22. Sitaram ChamartyJan 21, 2009
  23. GUI and detatched HEAD (was Re: Deleting remote branch pointed by remote HEAD)Daniel Barkalow, Jan 21, 2009
  24. Sitaram ChamartyJan 22, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.