Skip to content

fix(sync): abort failed rebase during --all-branches and report it#32

Merged
aclark4life merged 1 commit into
mainfrom
fix-sync-abort-failed-rebase
Jul 7, 2026
Merged

fix(sync): abort failed rebase during --all-branches and report it#32
aclark4life merged 1 commit into
mainfrom
fix-sync-abort-failed-rebase

Conversation

@aclark4life

Copy link
Copy Markdown
Collaborator

Summary

dbx sync --all-branches iterates over each mapped branch with git switch. Previously, if a branch's rebase hit conflicts (or targeted a missing upstream ref), _sync_repository returned "failed" but left git mid-rebase. That in-progress rebase then blocked the git switch to every remaining branch and the final restore of the original branch — one bad branch poisoned the whole run and left the repo in a surprising state.

Fix

  • Add abort_on_conflict to _sync_repository. When set, a failed rebase is git rebase --abort'd so the working tree is left clean, and the user is pointed at a manual rebase command.

  • --all-branches passes abort_on_conflict=True; single-repo dbx sync <repo> is unchanged (still leaves the rebase in progress for in-place conflict resolution).

  • The loop now collects failed branches and prints them at the end:

    ⚠️  Rebase these branch(es) manually: mongodb-6.0.x
    

Testing

  • New test test_repo_sync_all_branches_aborts_failed_rebase: first branch's rebase fails → verifies git rebase --abort runs, the loop continues to the next branch, the original branch is restored, and the failed branch is reported.
  • Full suite: 423 passed; ruff clean; docs build clean.

Docs

  • docs/features/django-fork.rst "Refreshing every release branch" documents the abort-and-report behavior with a manual-rebase recipe.

Under --all-branches a rebase conflict previously left git mid-rebase, which
blocked the git switch to the next branch and the final branch restore. Add
abort_on_conflict to _sync_repository: when set (only by --all-branches) a
failed rebase is aborted so the tree stays clean, the loop continues, and the
original branch is restored. Failed branches are listed at the end with a
manual-rebase hint. Single-repo sync is unchanged (still leaves the rebase in
progress for in-place conflict resolution).
@aclark4life aclark4life merged commit b4d3dfa into main Jul 7, 2026
@aclark4life aclark4life deleted the fix-sync-abort-failed-rebase branch July 7, 2026 17:20
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.

1 participant