feat(migrate): make orphan branch default for bd migrate sync#1148
Closed
peterkc wants to merge 1 commit intosteveyegge:mainfrom
Closed
feat(migrate): make orphan branch default for bd migrate sync#1148peterkc wants to merge 1 commit intosteveyegge:mainfrom
peterkc wants to merge 1 commit intosteveyegge:mainfrom
Conversation
87d02dc to
e639a04
Compare
Contributor
Author
CI NoteThe lint and version consistency failures are pre-existing issues on main, not caused by this PR. Lint failures (all in files not touched by this PR):
Version mismatch:
This PR only modifies:
All tests for |
e639a04 to
76198d5
Compare
New sync branches are created as orphan by default - no shared history with main, creating a clean "data sync channel" for beads. Changes: - New branches: Created as orphan via `git checkout --orphan` - Existing branches: Preserved as-is for backward compatibility - Migration: `--orphan` flag deletes and recreates existing branch - Safety check: Warns if --orphan would lose unpushed commits Why orphan branches: - Clean mental model (data-only branch, no code) - No accidental merge risk (git warns about unrelated histories) - Smaller repository footprint Addresses GH#1004 Phase 1 and GH#1125.
76198d5 to
a96fbc9
Compare
steveyegge
added a commit
that referenced
this pull request
Feb 5, 2026
Make orphan branches the default for `bd migrate sync` when creating new branches, providing cleaner separation of sync data from main code. Key changes: - New branches created as orphan by default (no shared history) - Existing branches used as-is (backward compatible) - --orphan flag to migrate existing branches to orphan - Safety checks for unpushed commits - Cross-platform fix: use --stdin instead of /dev/null Co-Authored-By: Peter Chanthamynavong <peterkc@users.noreply.github.com>
Owner
|
Merged manually to main with cross-platform fix (replaced /dev/null with --stdin for Windows compatibility). Thanks @peterkc! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Make orphan branches the default for
bd migrate syncand add--orphanflag for migrating existing branches.Key behavior:
--orphanto convert existing branch to orphanMotivation: As suggested in #1125's Alternative section and #1004, orphan branches provide:
Changes
--orphanflag migrates existing branches (delete + recreate as orphan)--orphanwould delete unpushed commitsgit commit-treeapproach to avoid working directory conflicts--orphanare preserved as-isBranch Creation Flow
Behavior Matrix
Backward Compatibility
Existing users with non-orphan sync branches are NOT affected:
branchExistsLocal()detects the existing branch--orphan, code uses existing branch as-isTo migrate:
bd migrate sync <branch> --orphanRelated Issues
Test Plan
TestMigrateSyncOrphan- Verifies orphan has no merge-base with mainTestMigrateSyncOrphanWorktree- Verifies worktree works with orphan branchesTestMigrateSyncExistingBranchPreserved- Verifies existing branches used as-isTestMigrateSyncOrphanMigration- Verifies --orphan migrates existing branch--orphan --force