get_git_log_all_repos
Retrieve git commits from multiple repositories to track coding contributions for resume building, with time-based filtering options.
Instructions
Get git commits from all configured repositories, grouped by repo
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| since | No | Time range for commits | 6 months ago |
Implementation Reference
- The main handler function that implements the get_git_log_all_repos tool. It iterates over all configured repositories, runs git log for the author since the specified time, groups the output by repository, counts commits, and returns formatted TextContent.async def get_git_log_all_repos(since: str) -> list[TextContent]: """Get git commits from all configured repositories.""" if not REPO_DICT: return [TextContent(type="text", text="No repositories configured")] all_output = f"Git commits from all repositories ({since}):\n\n" all_output += "="*60 + "\n\n" total_commits = 0 for repo_name, repo_path in REPO_DICT.items(): try: cmd = [ "git", "log", f"--author={AUTHOR_NAME}", "--no-merges", f"--since={since}", "--pretty=format:%h - %s (%cr)" ] result = subprocess.run( cmd, cwd=repo_path, capture_output=True, text=True, check=True ) output = result.stdout.strip() commit_count = len(output.split('\n')) if output else 0 total_commits += commit_count all_output += f"## {repo_name}\n" all_output += f"Path: {repo_path}\n" all_output += f"Commits: {commit_count}\n\n" if output: all_output += output + "\n\n" else: all_output += "No commits found\n\n" all_output += "-"*60 + "\n\n" except subprocess.CalledProcessError as e: all_output += f"## {repo_name}\n" all_output += f"Error: {e.stderr}\n\n" all_output += "-"*60 + "\n\n" all_output += f"Total commits across all repositories: {total_commits}" return [TextContent(type="text", text=all_output)]
- src/cv_resume_builder_mcp/server.py:143-156 (registration)Registers the get_git_log_all_repos tool in the MCP server's list_tools() function, including its name, description, and input schema.Tool( name="get_git_log_all_repos", description="Get git commits from all configured repositories, grouped by repo", inputSchema={ "type": "object", "properties": { "since": { "type": "string", "description": "Time range for commits", "default": "6 months ago" } } } ),
- Dispatch logic in the call_tool handler that routes calls to the get_git_log_all_repos function.elif name == "get_git_log_all_repos": return await get_git_log_all_repos(arguments.get("since", "6 months ago"))