agora.git.merge

Merge strategies for multi-agent branches.

At project completion, all agent/* branches merge into main.

Two strategies: - MergeStrategy.SQUASH: each branch becomes one squashed commit on the target

(clean history; drops intra-branch granularity).

  • MergeStrategy.FULL: regular merge, preserving the full commit graph (full provenance; history is noisier).

Conflict handling: if a merge conflicts, the working tree is reset cleanly and the branch is reported as conflicted. No auto-resolution — the project is marked for human review. Ordering: by first-commit author-time of each branch.

Classes

MergeManager

MergeResult

MergeResult(success: 'bool', merged_branches: 'list[str]' = <factory>, conflict_branches: 'list[str]' = <factory>, conflict_files: 'list[str]' = <factory>, final_commit_sha: 'str | None' = None)

MergeStrategy

class agora.git.merge.MergeStrategy[source]

Bases: str, Enum

SQUASH = 'squash'
FULL = 'full'
__new__(value)
class agora.git.merge.MergeResult[source]

Bases: object

MergeResult(success: ‘bool’, merged_branches: ‘list[str]’ = <factory>, conflict_branches: ‘list[str]’ = <factory>, conflict_files: ‘list[str]’ = <factory>, final_commit_sha: ‘str | None’ = None)

success: bool
merged_branches: list[str]
conflict_branches: list[str]
conflict_files: list[str]
final_commit_sha: str | None = None
__init__(success, merged_branches=<factory>, conflict_branches=<factory>, conflict_files=<factory>, final_commit_sha=None)
class agora.git.merge.MergeManager[source]

Bases: object

__init__(repo)[source]
merge_agent_branches(target_branch='main', strategy=MergeStrategy.SQUASH, branches=None)[source]

Merge all (or specified) agent branches into target_branch.

get_merge_order(branches)[source]

Order by the author-time of each branch’s first branch-unique commit.