You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Ability to edit title/body/metadata of already open PR #1349
Describe the feature or problem you’d like to solve
I'd like to be able to edit a PR I already have open. Obviously editing the commits is just a matter of git push, but I'd like to be able to edit the PR title and body as well.
Potential solutions:
gh pr edit 1234 gives prompts similar to gh pr create but only for the title and body. Users could separately push their branch to update the commits.
gh pr edit looks for a PR from the current branch and edits it with the current commits and specified title and body.
gh pr edit 1234 pushes commits from the current branch if they match the PR branch and allows editing the title and body.
gh pr create --overwrite acts exactly like gh pr create, but instead of getting an error like a pull request for branch "GMNGeoffrey:foo" into branch "main" already exists: overwrites that PR with the specified configuration.
I think I like the combination of 1 & 4. It seems weird to have create be the only way to edit a PR, but it might also be annoying to have to separately push to the branch or to know a-priori whether a PR already exists. 2 & 3 seem a bit too magic to me.
This gives the ability to fixup already-sent PRs without having to close and create a new one or break out of the CLI.
Reacted by Robert Fletcher, Philippe Blain, Andy Freeland, Milad Nekofar, Shu Kutsuzawa, Scott Todd, Bruno Pinto, Evan Freed, Alexey Korolev, oberprah and 8 more
I think this is a more generic problem. Issues need to be edited too.
What about for issues and PRs gh adopts exactly the same system as git, when editing commit messages? Presumably gh users are also git users so this would feel right.
Ah good point. Editing issues is indeed the more generic thing that should be offered, thanks! Maybe gh pr edit could have the additional behavior of defaulting to the PR for the current branch as gh pr view does? That would be consistent with the diff between gh issue view and gh pr view. And actually, maybe it should also push the new commits, as in proposal 2 above.
One case I think isn't covered there is proposal 4 above. If I'm writing a script that wants to do create-or-overwrite. If you can think of a good way to work that in, then that would be appreciated. It wouldn't be too hard to just check the exit code of gh pr view though to see if the current branch already has a PR.
It would be great to have a command to update the title/body of a PR from the latest commit. We have an amend based workflow and will often add additional details to the commit body. One thing that would be super helpful is maybe having a gh pr update command that works similar to gh pr create, but just updates the existing PR title/body.
fwiw, I'd love to also be able to edit the base branch as well. I end up having to change the base of most of my PRs when I batch them in release branches.
Activity
danshearer commentedon Jul 10, 2020
I think this is a more generic problem. Issues need to be edited too.
What about for issues and PRs gh adopts exactly the same system as git, when editing commit messages? Presumably gh users are also git users so this would feel right.
mislav commentedon Jul 10, 2020
Thanks for the suggestion!
There is already a feature request for editing issue body: #904
GMNGeoffrey commentedon Jul 10, 2020
Ah good point. Editing issues is indeed the more generic thing that should be offered, thanks! Maybe
gh pr editcould have the additional behavior of defaulting to the PR for the current branch asgh pr viewdoes? That would be consistent with the diff betweengh issue viewandgh pr view. And actually, maybe it should also push the new commits, as in proposal 2 above.One case I think isn't covered there is proposal 4 above. If I'm writing a script that wants to do create-or-overwrite. If you can think of a good way to work that in, then that would be appreciated. It wouldn't be too hard to just check the exit code of
gh pr viewthough to see if the current branch already has a PR.mockdeep commentedon Jul 11, 2020
It would be great to have a command to update the title/body of a PR from the latest commit. We have an
amendbased workflow and will often add additional details to the commit body. One thing that would be super helpful is maybe having agh pr updatecommand that works similar togh pr create, but just updates the existing PR title/body.malectro commentedon Sep 24, 2020
fwiw, I'd love to also be able to edit the base branch as well. I end up having to change the base of most of my PRs when I batch them in release branches.
vilmibm commentedon Sep 29, 2020
I feel like we can convert this into a general "edit existing PRs" issue and close #2015?
[-]Ability to edit title/body of already open PR[/-][+]Ability to edit title/body/metadata of already open PR[/+]covertbert commentedon Jan 6, 2021
I don't see any mention of labels so I was just wondering is the intention of this feature to also add the ability to add/remove labels?
Revert "Use existing script in submodule synchronize action (iree-org…
Revert "Use existing script in submodule action (#4358)" (#4457)
mislav commentedon Jan 15, 2021
@covertbert I think labels would definitely be editable if we provided features to edit issues and PRs.