module documentation
Utilities for reading and generating reflogs.
| Function | drop |
Drop the specified reflog entry. |
| Function | expire |
Expire reflog entries based on age and reachability. |
| Function | format |
Generate a single reflog line. |
| Function | iter |
Iterate over all reflogs in a repository. |
| Function | parse |
Parse a reflog line. |
| Function | parse |
Parse a reflog specification like 'HEAD@{1}' or 'refs/heads/master@{2}'. |
| Function | read |
Read reflog. |
| Variable | |
Undocumented |
def expire_reflog(f:
BinaryIO, expire_time: int | None = None, expire_unreachable_time: int | None = None, reachable_checker: Callable[ [ bytes], bool] | None = None) -> int:
¶
Expire reflog entries based on age and reachability.
| Parameters | |
f:BinaryIO | File-like object for the reflog |
expireint | None | Expire entries older than this timestamp (seconds since epoch). If None, entries are not expired based on age alone. |
expireint | None | Expire unreachable entries older than this timestamp. If None, unreachable entries are not expired. |
reachableCallable[ | Optional callable that takes a SHA and returns True if the commit is reachable. If None, all entries are considered reachable. |
| Returns | |
int | Number of entries expired |
Parse a reflog specification like 'HEAD@{1}' or 'refs/heads/master@{2}'.
| Parameters | |
refspec:str | bytes | Reflog specification (e.g., 'HEAD@{1}', 'master@{0}') |
| Returns | |
tuple[ | Tuple of (ref_name, index) where index is in Git reflog order (0 = newest) |
| Raises | |
ValueError | If the refspec is not a valid reflog specification |