Skip to content

Conversation

@newhook
Copy link
Owner

@newhook newhook commented Jan 28, 2026

Summary

This PR adds a configurable base branch setting for repositories, removing the hardcoded assumption that all repos use main as their primary branch.

  • Adds base_branch field to [repo] section in project config (config.toml)
  • Removes --base CLI flag from co work create (now uses project config)
  • Updates all fallback defaults to use GetBaseBranch() helper
  • Documents the new configuration option in config template

Changes

Configuration (internal/project/config.go):

  • Added BaseBranch field to RepoConfig struct
  • Added GetBaseBranch() method that returns configured value or "main" as default

Config Template (internal/project/templates/config.tmpl):

  • Added documented base_branch option with examples (e.g., "develop", "master")

Work Creation (cmd/work.go):

  • Removed --base flag from work create command
  • Now reads base branch from project configuration

Task Processing (cmd/task_processing.go):

  • Updated fallback to use GetBaseBranch() instead of hardcoded "main"

Control Plane (internal/control/handler_create_worktree.go):

  • Updated fallback to use GetBaseBranch()

TUI (internal/tui/tui_plan_work.go):

  • Updated to use GetBaseBranch() instead of hardcoded "main"

Work Package (internal/work/work.go):

  • Updated CreateWorkAsync fallback to use GetBaseBranch()

Documentation:

  • Updated CLAUDE.md and README.md to reflect the configuration-based approach

Issues Resolved

  • ac-a3ss: Base Branch Configuration (epic)
    • ac-a3ss.1: Add base_branch to RepoConfig struct
    • ac-a3ss.2: Update config template with base_branch documentation
    • ac-a3ss.3: Remove --base flag from work create CLI
    • ac-a3ss.4: Update TUI to use config base branch
    • ac-a3ss.5: Update fallback defaults to use config
    • ac-a3ss.6: Update documentation to remove --base flag

Usage

To configure a non-main base branch, edit your project's config.toml:

[repo]
type = "github"
source = "org/repo"
path = "main"
base_branch = "develop"  # Add this line

If not specified, defaults to "main" for backwards compatibility.

Testing

  • Build passes: go build -o co .
  • Tests pass: go test ./...
  • Manual verification with existing projects continues to work (defaults to "main")

🤖 Generated with Claude Code

Replaces hardcoded 'main' base branch with configurable [repo] base_branch
setting. This allows repositories like Parcel that use 'develop' as their
default branch to work correctly with the orchestrator.

Changes:
- Add BaseBranch field to RepoConfig with GetBaseBranch() method
- Remove --base flag from 'co work create' CLI
- Update TUI to use config base branch
- Update fallback defaults in work.go, handler_create_worktree.go,
  and task_processing.go to use config value
- Update config template with commented-out example
- Update documentation in CLAUDE.md and README.md

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@newhook newhook merged commit 2eba0ee into main Jan 28, 2026
3 checks passed
@newhook newhook deleted the feat/base-branch-configuration branch January 28, 2026 13:01
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