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

Re: Bug: Branch Deletion Doesn't Clean Up

From
Mike Hommey <mh@glandium.org>
Date
Feb 4, 2016, 08:12 UTC
Message-ID
<20160204081220.GA11434@glandium.org>
In-Reply-To
<20160204075500.GA21161@sigill.intra.peff.net>
On Thu, Feb 04, 2016 at 02:55:00AM -0500, Jeff King wrote:
Show 27 quoted lines
> [resend; sorry, I forgot to cc Michael on the first one]
> 
> On Thu, Jan 07, 2016 at 02:24:41PM -0500, Karl Moskowski wrote:
> 
> > The problem is, deleting a branch whose name contains slashes doesn’t
> > delete the directories in .git/refs/heads/.
> 
> Yes. Git's model is to leave the directories in place, and remove them
> only when they get in the way of creating another ref. In theory, the
> effect is the same as deleting the directories proactively.
> 
> But as you noticed, it does funny things with case-preserving
> filesystems. It also can cause performance problems if you have a very
> large number of empty directories (because git has to open each of them
> just to find out they're empty).
> 
> We can into the latter case at GitHub. Michael Haggerty (cc'd) worked up
> some patches recently for this, but I don't now if they're yet polished
> enough to send upstream.
> 
> > It seems like git branch -d ascend the hierarchy (up to
> > .git/refs/heads/), deleting any empty directories.
> 
> Yes, though it needs to be coupled with making the branch-creation
> process more robust to races (since we might create "refs/heads/foo" in
> order to make "refs/heads/foo/bar" while somebody else is deleting it to
> get rid of "refs/heads/foo/baz").

Can't we come up with a system that would update packed-refs directly instead of creating files?

Mike
Previous: Jeff KingNext: Jeff King
Message 4 of 7 in “Bug: Branch Deletion Doesn't Clean Up”
  1. Karl MoskowskiJan 7, 2016
  2. Jeff KingFeb 4, 2016
  3. Jeff KingFeb 4, 2016
  4. Mike HommeyFeb 4, 2016
  5. Jeff KingFeb 4, 2016
  6. Mike HommeyFeb 4, 2016
  7. Jeff KingFeb 4, 2016

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.