Skip to content

feat: add multi-repo workspace support for checkpoints#1

Merged
amir-prompt merged 2 commits intomainfrom
fix/multi-repo-workspace-support
Jan 27, 2026
Merged

feat: add multi-repo workspace support for checkpoints#1
amir-prompt merged 2 commits intomainfrom
fix/multi-repo-workspace-support

Conversation

@amir-prompt
Copy link
Collaborator

Summary

  • Adds support for workspaces containing multiple independent git repositories as subdirectories
  • Previously git-ai failed or only tracked one repository when the workspace root wasn't a git repo
  • Now each repository correctly receives its own attribution tracking and git notes

Changes

  • find_git_repo_for_path() - detect git repo root from file path
  • group_files_by_repository() - group edited files by their containing repo
  • filter_agent_run_for_repo() - filter AgentRunResult per repository
  • Modified handle_checkpoint() to create checkpoints for each repository
  • Added 5 unit tests for the new helper functions

Use Case

workspace/                    (NOT a git repository)
├── project-backend/          (git repo A) → Gets its own checkpoint
├── project-frontend/         (git repo B) → Gets its own checkpoint
└── shared-library/           (git repo C) → Gets its own checkpoint

Test plan

  • cargo check passes
  • cargo test --lib checkpoint - all 15 tests pass
  • cargo test --lib git_ai_handlers::tests - all 5 new tests pass
  • Single-repo workflows remain backward compatible

🤖 Generated with Claude Code

amir-prompt and others added 2 commits January 27, 2026 17:14
Previously, git-ai failed when the workspace root was not a git repository
but contained multiple git repositories as subdirectories. It would only
track attributions for one repository, losing AI edits in other repositories.

This change:
- Adds find_git_repo_for_path() to detect git repo root from file path
- Adds group_files_by_repository() to group edited files by their repo
- Adds filter_agent_run_for_repo() to filter AgentRunResult per repo
- Modifies handle_checkpoint() to create checkpoints for each repository

Now when an AI session edits files across multiple repos in a workspace,
each repo correctly receives its own attribution tracking and git notes.

Single-repo workflows remain fully backward compatible.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@amir-prompt amir-prompt merged commit fcdbc14 into main Jan 27, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants