Re: Bug: Branch Deletion Doesn't Clean Up

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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").

-Peff
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]