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

Re: ghost refs

From
Jeff King <peff@peff.net>
Date
Apr 20, 2010, 15:10 UTC
Message-ID
<20100420151014.GA11785@coredump.intra.peff.net>
In-Reply-To
<g2u76718491004200752gcf73abf1se05e89bd605e77a@mail.gmail.com>
On Tue, Apr 20, 2010 at 10:52:42AM -0400, Jay Soffian wrote:
Show 15 quoted lines
> On Tue, Apr 20, 2010 at 10:24 AM, Jeff King <peff@peff.net> wrote:
> > On Tue, Apr 20, 2010 at 09:33:42AM -0400, Jay Soffian wrote:
> > I like how the user would interact with that, but what happens with:
> >
> >  git checkout -b topic/subtopic
> >
> > The reflog of the deleted branch is in the way.
> 
> Handle it just as gracefully as we do today. This is what happens when
> you try to create a branch with a similar collision:
> 
> $ git branch foo/bar
> $ git branch foo
> error: there are still refs under 'refs/heads/foo'
> fatal: Failed to lock ref for update: Is a directory

Yeah, but my next step would be "branch -d foo/bar"; under your proposal that no longer works. Now I have to do "branch -m foo/bar foobar" where "foobar" is some name that I know means "the old reflog for foo/bar".

So I think it makes more sense to come up with that naming scheme ourselves and make using it semi-transparent.

Show 6 quoted lines
> $ git branch topic/subtopic
> error: there are still logs under 'logs/refs/heads/topic'
> fatal: Failed to lock log for update: Is a directory
> 
> I think it's an edge case; thus I think it's okay to fail as long as
> we give a reasonable error and a way to rename it.

It is an edge-case, but I'd rather just have a scheme that works nicely in the normal case and "degrades" only in the error case. Like if creating "foo/bar" we see that we have "foo", but that the last reflog entry is deletion, we move "foo" to "foo-1" or something. It's ugly, but it just doesn't come up that much.

-Peff
Previous: Alex Riesen
Message 30 of 30 in “ghost refs”
  1. John DlugoszApr 7, 2010
  2. Avery PennarunApr 7, 2010
  3. Jeff KingApr 7, 2010
  4. John DlugoszApr 7, 2010
  5. Avery PennarunApr 7, 2010
  6. John DlugoszApr 7, 2010
  7. Avery PennarunApr 7, 2010
  8. Jeff KingApr 8, 2010
  9. John DlugoszApr 8, 2010
  10. Junio C HamanoApr 8, 2010
  11. Jeff KingApr 8, 2010
  12. Junio C HamanoApr 8, 2010
  13. Avery PennarunApr 8, 2010
  14. Nicolas SebrechtApr 8, 2010
  15. Jeff KingApr 17, 2010
  16. Junio C HamanoApr 17, 2010
  17. Jakub NarebskiApr 17, 2010
  18. Junio C HamanoApr 18, 2010
  19. John DlugoszApr 19, 2010
  20. Yann DirsonApr 20, 2010
  21. Jeff KingApr 20, 2010
  22. ZeframApr 20, 2010
  23. Yann DirsonApr 20, 2010
  24. ZeframApr 20, 2010
  25. Jay SoffianApr 20, 2010
  26. Jeff KingApr 20, 2010
  27. Yann DirsonApr 20, 2010
  28. Jay SoffianApr 20, 2010
  29. Alex RiesenApr 20, 2010
  30. Jeff KingApr 20, 2010

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.