feat(gitlaunch): auto-create PR instead of printing the command#26
Merged
Conversation
create_pr_branch_for_push already creates and pushes the PR branch when a protected branch blocks a direct push, but it only printed the suggested `gh pr create` command as a "Next:" hint, leaving the user to run it by hand. Run `gh pr create --base <base> --head <branch> --fill` directly after a Y/n confirmation, so the whole protected-branch → PR flow completes inside the Git menu. Falls back to printing the manual command when gh is missing or PR creation fails, so no path regresses to a worse state than before. Co-Authored-By: Claude Opus 4.8 <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.
What
Make the Git menu's protected-branch flow actually open the pull request instead of just printing the
gh pr createcommand as a hint.Why
When a push to a protected branch (
main/master) is blocked,create_pr_branch_for_pushalready:mq/<slug>-<timestamp>branch,…and then only echoed
Next: gh pr create --base … --head … --fill, leaving the user to run it by hand. This finishes the flow inside the menu.Changes
terminal/launchers/gitlaunch.sh—create_pr_branch_for_push:Create the pull request now? [Y/n]and rungh pr create --base <base> --head <branch> --fillon confirm.gh pr createfails → prints the manual command and returns non-zero;ghnot installed → prints the manual command (previous behavior). No path ends worse off than before.Verification
bash -n gitlaunch.shparses cleangh pr createwith the correct--base/--headargsread … </dev/tty+confirmconvention already used elsewhere in the function🤖 Generated with Claude Code