fix(orphan): prompt for confirmation when orphaning multiple branches (#733)#748
Conversation
Current Aviator status
This pull request is currently open (not queued). How to mergeTo merge this PR, comment
See the real-time status of this PR on the
Aviator webapp.
Use the Aviator Chrome Extension
to see the status of your PR within GitHub.
|
🔃 FlexReview StatusCommon Owner:
Review SLO: |
There was a problem hiding this comment.
Code Review
This pull request introduces an interactive confirmation prompt when orphaning multiple branches using the av orphan command, along with a --yes flag to bypass the prompt. The core logic has been refactored into collectBranchesToOrphan and orphanBranches functions, and a new test case verifies that denying the prompt prevents the orphaning process. A typo was identified in the success message where 'branched' should be 'branches'.
|
|
||
| fmt.Fprintf( | ||
| os.Stderr, | ||
| "These branched are orphaned: %s\n", |
Summary
av orphannow prompts for confirmation when it would orphan more than one branch, mirroring the trunk-context prompt pattern fromav sync. A--yes/-yflag skips the prompt for scripted use.Why this matters
From #733:
av syncalready has the right pattern atcmd/av/sync.go:169-183, where the trunk-from-trunk case prompts "You are on the trunk, do you want to sync all stacks?" This patch mirrors that for multi-branch / trunk-context orphan operations.Changes
cmd/av/orphan.go: predicate + prompt +--yesflag, listing branches that will be orphanedcmd/av/orphan_test.go: new unit tests for prompt-denied / prompt-accepted / single-branch / --yes pathse2e_tests/orphan_test.go: updated to thread through the new promptSingle-branch orphans from a feature branch are unchanged (no prompt). Pattern matches
cmd/av/sync.go:169-183.Fixes #733