Submit a suggested change to a PR from the Github CLI #5904
Replies: 5 comments 1 reply
-
An addendum to this idea: Instead of just suggesting all of the staged changes on the PR branch, you could suggest only certain patches. That way your suggested changes could be more focussed. |
Beta Was this translation helpful? Give feedback.
-
@mislav and @samcoe, is there any word on whether this feature might be considered for implementation? |
Beta Was this translation helpful? Give feedback.
-
Adding a +1 to this. One of the (content) editors I work with has accessibility issues and tends to work primarily from the command line. As it is, they're shut out from using the Suggest feature simply because they can't navigate the UI with ease. This is worse when they're the content author, as accepting suggestions often comes with length keyboard-based navigation on their part. They're comfortable receiving commits on their branches for edits, but ideally we'd like to standardize around a common way of doing things :) CLI commands would go a long way in making this accessible for that wonderful teammate. |
Beta Was this translation helpful? Give feedback.
-
+1 |
Beta Was this translation helpful? Give feedback.
-
Seems like there is a lot of interest for this feature. If anyone has any free time (I do not), I'd love to see a PR mocking out this idea. Maybe if we can demonstrate its feasibility, Github will invest some resources to build it out. |
Beta Was this translation helpful? Give feedback.
-
You know...
Have you used the "Add a suggestion" button when sumbmitting feedback to a PR? This allows reviewers to submit changes that can be committed directly to the PR branch. This is a great feature and can make it easier for users to collaborate on a PR and saves time, especially if a reviewer already knows how to fix an issue in the PR and can provide a commitable piece of code to the PR.
What if...
But what if we could submit changes to a PR through gh cli? Imagine checking out someone's code with
gh pr checkout [pr number]
. Then you could look at the person's PR in any IDE or text editor that you wish on your local machine. If you want to submit a suggestion, you would do so directly in your editor. These diff-able changes would be picked up by git of course. But instead of committing those changes directly to the person's PR (which you wouldn't want to do; your code is just a suggestion), you could run a command such asgh pr suggest [pr number]
. The cli would pick up staged but uncommited changes and push them directly to the PR as a comment with "suggest changes" that could be directly applied to the PR.How...
Essentially the process would be...
gh pr checkout [pr number]
git add -A
gh pr suggest [pr number]
Why...
Two of the main benefits of a feature like this are as follows:
gh already gives you the ability to review and add comments to PRs. My suggested feature would streamline the proccess of reviewing and submitting suggestions to the PR.
Also discussed here: #5905
Beta Was this translation helpful? Give feedback.
All reactions