Skip to content

feat: add --pull-default flag to par start and workspace start#26

Open
userhas404d wants to merge 4 commits into
coplane:mainfrom
userhas404d:main
Open

feat: add --pull-default flag to par start and workspace start#26
userhas404d wants to merge 4 commits into
coplane:mainfrom
userhas404d:main

Conversation

@userhas404d
Copy link
Copy Markdown

Summary

Closes #23

Adds --pull-default support to both par start (single-repo) and par workspace start (multi-repo) commands.

When --pull-default is used, the default branch for each repository is detected via origin/HEAD, pulled with --ff-only, and used as the base for new worktree branches. An explicit --base still takes precedence.

Changes

Single-repo par start --pull-default

  • Added pull_default: bool parameter to core.start_session()
  • Added --pull-default CLI flag to start / create commands
  • When set: detects default branch, pulls it, uses it as worktree base
  • 4 new tests covering CLI forwarding and core behavior

Multi-repo par workspace start --pull-default (existing)

  • Already implemented — included here for completeness of the upstream PR

README

  • Updated quick start examples
  • Updated detailed session docs
  • Updated "Keeping branches up-to-date" section to cover both single-repo and workspace usage

Usage

# Single-repo: pull default branch before creating worktree
par start feature-auth --pull-default

# Single-repo: --base still takes precedence
par start feature-auth --pull-default --base develop

# Multi-repo workspace (existing behavior)
par workspace start feature-auth --repos frontend,backend --pull-default

Testing

All 48 tests pass, including 4 new tests:

  • test_cli_start_forwards_pull_default
  • test_cli_start_pull_default_off_by_default
  • test_start_session_pull_default_uses_default_branch_as_base
  • test_start_session_pull_default_with_explicit_base

vimota and others added 4 commits April 2, 2026 11:28
Add an opt-in --pull-default flag to 'par workspace start' that
automatically pulls each repository's default branch (via origin/HEAD)
before creating workspace branches. This ensures workspace branches
are always based on up-to-date upstream code.

Behavior when --pull-default is passed:
1. Determine each repo's default branch via origin/HEAD
2. Checkout that branch in each repo
3. Run git pull --ff-only to update it
4. Create workspace branches from the updated default branch

The flag is opt-in and preserves existing behavior when not provided.

Closes coplane#23
feat: add --pull-default flag to workspace start
Add --pull-default to single-repo 'par start' command, mirroring the
existing workspace behavior. When set, the default branch is detected
via origin/HEAD, pulled with --ff-only, and used as the base for the
new worktree branch. An explicit --base still takes precedence.

- Add pull_default param to core.start_session()
- Add --pull-default CLI flag to start/create commands
- Add 4 new tests covering CLI forwarding and core behavior
- Update README with single-repo --pull-default docs
feat: add --pull-default flag to par start
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.

Feature request: pull default branch before workspace start

2 participants