Skip to main content

Module gc

Module gc 

Source
Expand description

gc: explicit, opt-in garbage collection. Never runs as a side effect of normal use — commits are only ever removed when a caller deliberately invokes this.

Functions§

gc
Removes every commit not reachable from any branch, returning the ids that were removed. A commit dropped from every branch (e.g. via rollback) but still hash-reachable from nowhere else becomes eligible here — until gc runs, it stays in storage.
reachable_from_branches
All commit ids reachable from any branch pointer, following every parent edge (not just first-parent) — a merge commit’s second parent must stay reachable too.