Allow PR reviewers to comment on and suggest changes to unedited lines of code #4452
Replies: 76 comments 74 replies
-
Relevant. isaacs/github#1655 |
Beta Was this translation helpful? Give feedback.
-
Yeah, hardly a day goes by that I don't want to comment on some line but the GitHub UI is like "nope, if you want to talk about that line go write out in English |
Beta Was this translation helpful? Give feedback.
-
How is this not a thing already? GitHub PRs are by far the worst code review tool I've ever used. This would make it a tiny bit better. |
Beta Was this translation helpful? Give feedback.
-
I just needed this feature today, I wanted to point out something that is related to the change but not part of it. |
Beta Was this translation helpful? Give feedback.
-
I also needed this feature today in order to comment on some code not changed by the PR but relevant to the PR's changes. |
Beta Was this translation helpful? Give feedback.
-
I'd think that it's a problem to do because code suggestions need to be retained, even as "outdated", even after PR author pushes more commits or even rebases and force-pushes the branch. Probably comments are linked to specific lines in the unified patch of the PR. |
Beta Was this translation helpful? Give feedback.
-
Completely bizarre that this is not possible. Case in point: a PR refactors a file from JS to TS. If a line has not been refactored and therefore changed, how do I point it out to the dev?? |
Beta Was this translation helpful? Give feedback.
-
Thanks for the feedback. We understand the need and are investigating the feasibility this quarter. 2021-12-19 update: Commenting on any line of a file changed in the pull request is on the roadmap for next quarter: github/roadmap#347. Please use #9099 to discuss commenting on unchanged files. |
Beta Was this translation helpful? Give feedback.
-
++ |
Beta Was this translation helpful? Give feedback.
-
One of my favorite changes to GitHub's PR review experience was the introduction of suggested changes. I regularly use this feature in documentation PRs; suggesting changes really helps speed up the review cycle by allowing me to prepare a necessary change and allowing the PR creator to review and accept it rather than me commenting how we should modify the text. A major drawback to the current implementation, though, is that the GitHub UI does not allow reviewers to suggest changes to lines that are not directly affected by the PR. Hovering over a line in right next to changed lines gives an 'add line comment' button Hovering over a line that was hidden behind the "Expand up" or "Expand down" buttons does not display an 'add line comment' button Please allow reviewers to comment on and suggest changes to any line in the files under review. Replies Arcanorum image 0 replies davisking 0 replies ChJones-IDM 0 replies ayyadalaa 0 replies star-square 0 replies codesnik 0 replies whenmoon 0 replies willsmythe 8 replies @swythan Think "Security Linter" where one config change might cause another part of the configuration to become invalid (or to need a warning about the possibly unexpected cascaded change). @willsmythe I created a new discussion specifically about commenting on unchanged files: #9099. Please add any additional comments there (and upvote if this is something you need). @swythan - can you create a new discussion for your request about review bots and annotations? It wasn't clear if you were asking that unmodified, annotated files just be visible in the Files Changed tab, or for also allowing users to comment on them. @swythan I'll forward this to the team that was trying to do this. @AndrewMonteith @LittleHuman1 Write a reply |
Beta Was this translation helpful? Give feedback.
-
How can we tell the progress of github/roadmap#347, since Q1 is over and it is not possible still, just wondering if there is status somewhere, has it been started or not, almost done, done but waiting for official release, etc. |
Beta Was this translation helpful? Give feedback.
-
Github is really disappointing compared to Gitlabs. And they're supposed to be the originators. |
Beta Was this translation helpful? Give feedback.
-
@jeffsaremi don't lose your hope on them man |
Beta Was this translation helpful? Give feedback.
-
Upvoted. This would be incredibly useful. |
Beta Was this translation helpful? Give feedback.
-
+1 |
Beta Was this translation helpful? Give feedback.
-
Github, I will name one of my cats Octocat if you add this, please 🐙 |
Beta Was this translation helpful? Give feedback.
-
Commenting from February 2025 when this feature still hasn't been implemented. Come on github. You can do it. |
Beta Was this translation helpful? Give feedback.
-
Basic feature missing! |
Beta Was this translation helpful? Give feedback.
-
I have needed to provide suggestions on unchanged lines several times (including just now)... but have to opt for the less-specific file-level comment. This feature would be very, very appreciated! |
Beta Was this translation helpful? Give feedback.
-
I just found myself needing this feature for the 1000th time today :) |
Beta Was this translation helpful? Give feedback.
-
Between this issue and the original it looks like this problem has over 3000 upvotes, making it the top thing your customers want solved. |
Beta Was this translation helpful? Give feedback.
-
I just did a review where this ended up being an issue multiple times. It's so frustrating to not be able to provide proper feedback when the line I want to comment on is right there, but just out of reach! Sorry for venting my frustration. :) |
Beta Was this translation helpful? Give feedback.
-
FWIW, here’s a simple hack I follow: I select multiple lines in the file (even if they are not part of the current PR). When you select lines, the URL in the browser updates to include the selected line numbers. If you copy this URL and open it in another tab, you'll see the selected lines highlighted. You can copy this URL and put in comment section of that particular file. |
Beta Was this translation helpful? Give feedback.
-
This is an important issue that many including myself have been thinking about for quite a long time. Today I came across a conflict that made me ask the following question: In what scenarios is the motivation behind the request for this feature not addressed by simply stacking another PR onto the source branch of the PR you're reviewing (even if it's an open source project and you're actually stacking that PR from your fork onto another third-party fork)? The PR OP can then either merge your stacked PR, cherry-pick, or whatever else they want but you both get a proper patch diff and you can of course edit anything in the stacked branch and then (perma)link to the proposed changes in your review comments. Apologies if this has already been proposed above and I missed it. |
Beta Was this translation helpful? Give feedback.
This comment was marked as spam.
This comment was marked as spam.
-
Yet another missing GitHub feature in the core code review product that Gerrit has long supported for over a decade. |
Beta Was this translation helpful? Give feedback.
-
+1, ReviewBoard has this feature, its very useful |
Beta Was this translation helpful? Give feedback.
-
GitLab has this feature and it has been critically important in MR reviews there. Unfortunately, we also have some repos in GitHub, which means PRs also need to be reviewed there for some things. It has been very limiting to not have this basic feature available in GitHub that is available in GitLab. As an example, I recently reviewed a PR in GitHub where a change was made to a certain line in a file. I added a suggested change with important updates to that line. That update then required making changes to another line in the same file that wasn't already changed in the PR. I couldn't add a suggested change or comment to the unchanged line, which was incredibly frustrating. When that happens, especially in PRs that require multiple line changes across multiple files that haven't already been changed in the PR, it's MUCH more difficult to track and make sure those lines are properly updated when you can't add comments to unchanged lines that need to be resolved before a PR can be merged. This is a feature I need to use almost daily, which I can use in GitLab, but not GitHub. I much prefer the merge request review experience in GitLab and I'm regularly frustrated every time I need to do a review in GitHub. This is one of my biggest sore points in using GitHub (though certainly not the only one), and it has me hoping our team can eventually move all repos to GitLab, where the code review experience is so much better. |
Beta Was this translation helpful? Give feedback.
-
even Atlassian introduced this feature in bitbucket. its been around 3years i added a comment here to add this feature. don't know what the GitHub team is thinking. |
Beta Was this translation helpful? Give feedback.
-
I just ran into this issue today, and would like to request eyes on this. It's an awkward workaround to have to make a general comment that says, "go look at this line over there and make such and such a change because of what you did over here." |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
One of my favorite changes to GitHub's PR review experience was the introduction of suggested changes. I regularly use this feature in documentation PRs; suggesting changes really helps speed up the review cycle by allowing me to prepare a necessary change and allowing the PR creator to review and accept it rather than me commenting how we should modify the text.
A major drawback to the current implementation, though, is that the GitHub UI does not allow reviewers to suggest changes to lines that are not directly affected by the PR.
Hovering over a line in right next to changed lines gives an 'add line comment' button

Hovering over a line that was hidden behind the "Expand up" or "Expand down" buttons does not display an 'add line comment' button

Please allow reviewers to comment on and suggest changes to any line in the files under review.
July 14, 2023 update: Unmarked @willsmythe's comment as an answer to this request as github/roadmap#347 is still open and on the backlog.
Beta Was this translation helpful? Give feedback.
All reactions