agora.git.repo_manager

Git repository lifecycle: init, branch-per-agent, checkout, diff, log.

Wraps GitPython. The Repo object may be injected for testing, but the default path is straightforward: open an existing repo at repo_path or init it.

Branch naming convention for agent work: agent/<name>/<task-id>.

Classes

RepoManager

Thin wrapper around a git.Repo with Agora-specific conventions.

class agora.git.repo_manager.RepoManager[source]

Bases: object

Thin wrapper around a git.Repo with Agora-specific conventions.

__init__(repo_path, repo=None)[source]
init_project_repo(project_name)[source]

Initialize a fresh repo with a root commit on main.

property repo: Repo
create_agent_branch(agent_name, task_id)[source]

Create and checkout agent/<name>/<task-id>. Returns the branch name.

checkout(branch)[source]
list_agent_branches()[source]
get_current_branch()[source]
has_uncommitted_changes()[source]
commit_all(message, agent_name='agora', email_domain='agora.local')[source]

Stage all changes (tracked + untracked) and commit. Returns commit SHA.

Used by the agent runtime’s git_commit tool; for structured commits use CommitStrategy.

diff(ref=None)[source]

Unified diff of working tree vs HEAD (or vs ref).

log(limit=10, branch=None)[source]

Return git log output for the active or specified branch.