fix: warn and prompt on branch existence during create - #21
Merged
Conversation
Previously `repo create` silently created a new branch from origin/HEAD
when the requested branch name didn't exist anywhere. This caused
confusion when a branch existed on the remote with a slightly different
name (e.g. a typo). Now the CLI warns the user, suggests similar branch
names ("Did you mean?"), and asks for confirmation before proceeding.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Previously, `repo create` silently used an existing remote branch without informing the user. Now it shows branch info (last commit, age) and offers options: use existing, enter a different name, or cancel. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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
repo createnow checks branch existence in both directions: warns when a branch doesn't exist on remote (with "Did you mean?" suggestions), and prompts with branch info when it already exists--yesflag auto-accepts in both cases for non-interactive useChanges
get_branch_info(),find_similar_branches(),list_remote_branches(), andbranch_exists()helpers for branch discoveryget_branch_infoTest plan
pytest tests/)repo create <repo> <existing-branch>shows info + menurepo create <repo> <typo-branch>shows suggestions