class documentation
class ObjectReachabilityProvider(Protocol):
Protocol for computing object reachability queries.
This abstraction allows reachability computations to be backed by either naive graph traversal or optimized bitmap indexes, with a consistent interface.
| Method | get |
Get all commits reachable from heads, excluding those in exclude. |
| Method | get |
Get all objects (commits + trees + blobs) reachable from commits. |
| Method | get |
Get all trees and blobs reachable from the given trees. |
def get_reachable_commits(self, heads:
Iterable[ ObjectID], exclude: Iterable[ ObjectID] | None = None, shallow: Set[ ObjectID] | None = None) -> set[ ObjectID]:
¶
Get all commits reachable from heads, excluding those in exclude.
| Parameters | |
heads:Iterable[ | Starting commit SHAs |
exclude:Iterable[ | Commit SHAs to exclude (and their ancestors) |
shallow:Set[ | Set of shallow commit boundaries (traversal stops here) |
| Returns | |
set[ | Set of commit SHAs reachable from heads but not from exclude |