Module gc

Source
Expand description

Deal with Git’s garbage collection mechanism.

Git treats a commit as unreachable if there are no references that point to it or one of its descendants. However, the branchless workflow requires keeping such commits reachable until the user has obsoleted them.

This module is responsible for adding extra references to Git, so that Git’s garbage collection doesn’t collect commits which branchless thinks are still active.

Functions§

find_dangling_references
Find references under refs/branchless/ which point to commits which are no longer active. These are safe to remove.
gc
Run branchless’s garbage collection.
mark_commit_reachable
Mark a commit as reachable.