module documentation

Git maintenance implementation.

This module provides the git maintenance functionality for optimizing and maintaining Git repositories.

Class CommitGraphTask Commit-graph maintenance task.
Class GcTask Garbage collection maintenance task.
Class IncrementalRepackTask Incremental-repack maintenance task.
Class LooseObjectsTask Loose-objects maintenance task.
Class MaintenanceResult Result from running maintenance tasks.
Class MaintenanceSchedule Maintenance schedule types.
Class MaintenanceTask Base class for maintenance tasks.
Class PackRefsTask Pack-refs maintenance task.
Class PrefetchTask Prefetch maintenance task.
Function get_enabled_tasks Get list of enabled maintenance tasks.
Function register_repository Register a repository for background maintenance.
Function run_maintenance Run maintenance tasks on a repository.
Function unregister_repository Unregister a repository from background maintenance.
Constant MAINTENANCE_TASKS Undocumented
Variable logger Undocumented
def get_enabled_tasks(repo: BaseRepo, task_filter: list[str] | None = None) -> list[str]:

Get list of enabled maintenance tasks.

Parameters
repo:BaseRepoRepository object
task_filter:list[str] | NoneOptional list of specific task names to run
Returns
list[str]List of enabled task names
def register_repository(repo: Repo):

Register a repository for background maintenance.

This adds the repository to the global maintenance.repo config and sets up recommended configuration for scheduled maintenance.

Parameters
repo:RepoRepository to register
def run_maintenance(repo: BaseRepo, tasks: list[str] | None = None, auto: bool = False, progress: Callable[[str], None] | None = None) -> MaintenanceResult:

Run maintenance tasks on a repository.

Parameters
repo:BaseRepoRepository object
tasks:list[str] | NoneOptional list of specific task names to run
auto:boolIf True, only run tasks if needed
progress:Callable[[str], None] | NoneOptional progress callback
Returns
MaintenanceResultMaintenanceResult with task execution results
def unregister_repository(repo: Repo, force: bool = False):

Unregister a repository from background maintenance.

This removes the repository from the global maintenance.repo config.

Parameters
repo:RepoRepository to unregister
force:boolIf True, don't error if repository is not registered
Raises
ValueErrorIf repository is not registered and force is False
MAINTENANCE_TASKS: dict[str, type[MaintenanceTask]] =

Undocumented

Value
{'gc': GcTask,
 'commit-graph': CommitGraphTask,
 'loose-objects': LooseObjectsTask,
 'incremental-repack': IncrementalRepackTask,
 'pack-refs': PackRefsTask,
 'prefetch': PrefetchTask}
logger =

Undocumented