Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

git-branchless accumulates too many anti-GC references #1125

Open
arxanas opened this issue Nov 7, 2023 · 0 comments
Open

git-branchless accumulates too many anti-GC references #1125

arxanas opened this issue Nov 7, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@arxanas
Copy link
Owner

arxanas commented Nov 7, 2023

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

@arxanas arxanas added the bug Something isn't working label Nov 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant