Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions ontokit/api/routes/projects.py
Original file line number Diff line number Diff line change
Expand Up @@ -708,6 +708,16 @@ async def get_revision_history(
# Get commit history
commits = git.get_history(project_id, limit=limit)

# Build refs map: commit hash → branch names pointing at it
refs: dict[str, list[str]] = {}
try:
branches = git.list_branches(project_id)
for branch_info in branches:
if branch_info.commit_hash:
refs.setdefault(branch_info.commit_hash, []).append(branch_info.name)
except Exception:
pass # Non-critical: graph still works without ref labels

return RevisionHistoryResponse(
project_id=project_id,
commits=[
Expand All @@ -725,6 +735,7 @@ async def get_revision_history(
for c in commits
],
total=len(commits),
refs=refs,
)


Expand Down
4 changes: 4 additions & 0 deletions ontokit/schemas/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,10 @@ class RevisionHistoryResponse(BaseModel):
project_id: UUID
commits: list[RevisionCommit]
total: int
refs: dict[str, list[str]] = Field(
default_factory=dict,
description="Map of commit hash to branch names pointing at that commit",
)


class RevisionDiffChange(BaseModel):
Expand Down