mirror of
https://github.com/coleam00/Archon.git
synced 2025-12-23 18:29:18 -05:00
Update work order table to show branch name, and the commit operations count bug that is showing commits of the whole main branch vs. the work order changes.
This commit is contained in:
@@ -164,10 +164,10 @@ export function WorkOrderRow({
|
||||
<span className="text-sm text-gray-900 dark:text-white">{displayRepo}</span>
|
||||
</td>
|
||||
|
||||
{/* Request Summary */}
|
||||
{/* Branch */}
|
||||
<td className="px-4 py-2">
|
||||
<p className="text-sm text-gray-900 dark:text-white line-clamp-2">
|
||||
{workOrder.github_issue_number ? `Issue #${workOrder.github_issue_number}` : "Work order in progress"}
|
||||
{workOrder.git_branch_name || <span className="text-gray-400 dark:text-gray-500">-</span>}
|
||||
</p>
|
||||
</td>
|
||||
|
||||
|
||||
@@ -113,7 +113,7 @@ export function WorkOrderTable({ workOrders, selectedRepositoryId, onStartWorkOr
|
||||
Repository
|
||||
</th>
|
||||
<th className="px-4 py-3 text-left text-sm font-medium text-gray-700 dark:text-gray-300">
|
||||
Request Summary
|
||||
Branch
|
||||
</th>
|
||||
<th className="px-4 py-3 text-left text-sm font-medium text-gray-700 dark:text-gray-300 w-32">Status</th>
|
||||
<th className="px-4 py-3 text-left text-sm font-medium text-gray-700 dark:text-gray-300 w-32">Actions</th>
|
||||
|
||||
@@ -7,19 +7,20 @@ import subprocess
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
async def get_commit_count(branch_name: str, repo_path: str | Path) -> int:
|
||||
"""Get the number of commits on a branch
|
||||
async def get_commit_count(branch_name: str, repo_path: str | Path, base_branch: str = "main") -> int:
|
||||
"""Get the number of commits added on a branch compared to base
|
||||
|
||||
Args:
|
||||
branch_name: Name of the git branch
|
||||
repo_path: Path to the git repository
|
||||
base_branch: Base branch to compare against (default: "main")
|
||||
|
||||
Returns:
|
||||
Number of commits on the branch
|
||||
Number of commits added on this branch (not total branch history)
|
||||
"""
|
||||
try:
|
||||
result = subprocess.run(
|
||||
["git", "rev-list", "--count", branch_name],
|
||||
["git", "rev-list", "--count", f"origin/{base_branch}..{branch_name}"],
|
||||
cwd=str(repo_path),
|
||||
capture_output=True,
|
||||
text=True,
|
||||
|
||||
Reference in New Issue
Block a user