git-branchless accumulates too many anti-GC references
arxanas opened this issue · comments
Waleed Khan commented
Description of the bug
Over 8-ish months with my current repo, git-branchless has accumulated something like 100k references under refs/branchless/*
. This pessimizes any operation that traverses all references.
Expected behavior
git branchless gc
should compact references so that there aren't 100k of them. Possible procedure:
- Find all live heads and create new anti-GC references for them.
- Delete all anti-GC references that aren't one of those heads.
- It's possible that this could be an O(n^2) operation if we have to operate on a
packed-refs
file; I don't know that libgit2 allows us to delete a bunch of references in bulk (or ifgit update-ref
does).
- It's possible that this could be an O(n^2) operation if we have to operate on a
Actual behavior
git branchless gc
only deletes references to commits that are no longer visible.
Version of rustc
No response
Automated bug report
No response
Version of git-branchless
No response
Version of git
No response