Allow specifying the branch name when reverting a pull request, and make the ruleset error actionable #206033
Unanswered
yuki2006
asked this question in
Pull Requests
Replies: 1 comment
|
💬 Your Product Feedback Has Been Submitted 🎉 Thank you for taking the time to share your insights with us! Your feedback is invaluable as we build a better GitHub experience for all our users. Here's what you can expect moving forward ⏩
Where to look to see what's shipping 👀
What you can do in the meantime 💻
As a member of the GitHub community, your participation is essential. While we can't promise that every suggestion will be implemented, we want to emphasize that your feedback is instrumental in guiding our decisions and priorities. Thank you once again for your contribution to making GitHub even better! We're grateful for your ongoing support and collaboration in shaping the future of our platform. ⭐ |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
🏷️ Discussion Type
Product Feedback
Body
Problem
Clicking Revert on a merged pull request always creates a branch named
revert-<PR number>-<head branch name>. There is no way to change that name:gh pr revert— only--title,--body,--draftrevertPullRequest—RevertPullRequestInputaccepts onlypullRequestId,title,body,draft,clientMutationIdIn a repository whose ruleset enables Restrict creations, that fixed name falls outside the allowed patterns, so creating the ref is rejected and the revert fails:
The Revert button is therefore unusable for us. We have to fall back to reverting by hand with git — which is exactly the workflow the button exists to avoid, and the one we least want to be doing under pressure right after a bad merge has reached the default branch.
Note that these two features are individually reasonable but structurally incompatible: rulesets ask you to constrain branch names, and revert insists on a name you cannot constrain.
Request 1: let us choose the branch name
Please add an optional branch name to the revert flow:
gh pr revert— a--branch/-bflagbranchNamefield onRevertPullRequestInputA repository-level setting for a revert branch name template (e.g.
fix/revert-{number}) would also solve the web UI case, and would let an organization keep revert branches consistent with the rest of its naming policy.Request 2: make the error message actionable
Independently of Request 1, the current failure message states neither what was attempted nor what blocked it. Please include:
Something like:
would turn a multi-minute guessing game into a five-second fix. As written today, the message does not even reveal that a branch name was involved, so there is no obvious path from the error to the cause.
All reactions