Add --resume option to cut-branch to continue an interrupted cut#6
Open
zeyap wants to merge 1 commit into
Open
Add --resume option to cut-branch to continue an interrupted cut#6zeyap wants to merge 1 commit into
zeyap wants to merge 1 commit into
Conversation
cut-branch aborts if the stable branch already exists and has no way to pick up a partially completed cut. This adds --resume <step> to skip all steps before the given number (and the branch-exists abort), so an interrupted cut can be continued from the middle. - --resume <n> runs steps n..13; earlier steps are skipped - --resume with no value lists the 13 steps and exits - when resuming into the branch-local steps (8-12), the stable branch is checked out first since the normal checkout step (7) is skipped - step titles now live in a single STEP_TITLES array that also drives the total step count
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
cut-branchaborts at step 4 if the stable branch already exists, and there's no way to pick up a cut that was interrupted partway through (e.g. the branch got created but the Hermes bump / template branch / follow-up steps never ran). Today the only recovery is to delete the stable branch and start over — which is impossible when the branch is protected.This adds a
--resume <step>option that skips every step before the given number (including the "branch already exists" abort), so an interrupted cut can be continued from the middle.What's included
--resume <n>runs stepsn..13; all earlier steps are skipped.--resumewith no value prints the list of 13 steps and exits, so you can find the number to resume from.STEP_TITLESarray that also drivesTOTAL_STEPS, so the count can't drift.--resume <step>.Note: steps 5 (resolve source) and 6 (create branch) are coupled — the resolved SHA feeds branch creation — so they're gated together (
--resume 6runs both).Test plan
cut-branch --series 0.87 --resume→ lists all 13 steps and exits without side effects.cut-branch --series 0.87 --resume 8 --dry-run→ prints "Resuming from step 8/13", skips steps 1–7, and starts at[8/13].cut-branch --series 0.87(no--resume) → unchanged behavior, runs 1→13.--resume 0,--resume 99,--resume abc) → clear error and exit 1.