arxanas / git-branchless

High-velocity, monorepo-scale workflow for Git

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

git-branchless accumulates too many anti-GC references

arxanas opened this issue · comments

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 if git update-ref does).

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