How to comment on long github diff - github

One of the files in a pull request that I'm currently reviewing has too many changes and github only shows the summary about deletions and additions.
This is rather unfortunate, since I can't comment on the changes that happened in this file. Is there any way to force github to show the diff for this one file in the PR and enable the comment functionality?
Thanks!

You can't force it to comment from the browser, but you can workaround it to create the comment and have someone see it.
In Large github commit diff not shown, they say a Hubber said:
We have some limits on diffs that we show in the browser in order to keep the pull request and compare pages working.
As of today, GitHub's help still states there are (bigger) limits.
If you know the lines you want to comment you could use GitHub's API to create the comment. I don't know if that comment will show on the diff page (I don't think so, as there won't be a diff at all), but you will certainly see it on the comments tab, as usual.

Related

Disable "hidden conversations" in GitHub pull requests?

When I go to a page of an open PR in GitHub, e.g. https://github.com/xyz/abc/pull/123, when the number of conversations exceeds some limit, GitHub automatically collapses some of them in the middle under a box that says "[n] hidden conversations"; you have to click "Load more" in order to see them.
Since the open conversations are the most important thing on a PR and the reason I open or refresh the page in the first place, is there a way to undo this and always show all the conversations? I haven't seen anything relevant in settings; does a browser extension exist to do this?
I've had the same issues. This isn't a solution, but it might be a workaround. I only just discovered it, so I'll have to see how it feels going forward.
In a GitHub PR, change the tab from "Conversation" to "Files changes"
There's a new dropdown called "Conversations", which seems to list all of them.
User ldog explains some limitations with this in the comments below:
Unfortunately this only works if the comments are in sync with the latest commit or the commits that you are currently looking at, if you wanted to see all comments across all commits, this doesn't work. For example, when clicking on a comment that no longer exists due to code changes in a commit this does nothing.
I would prefer to find the same solution the OP is seeking, but I wanted to share this for anyone else landing here with the same issue in case someone finds it helpful.
Also, I'm cross-posting this information in a related webapps.stackexchange question: https://webapps.stackexchange.com/questions/148308/how-to-always-show-all-pr-conversations-in-github

GitHub pull request reviews line comments behaviour

Recently GitHub introduced some new features including Pull Request Reviews.
In the past, line comments in Pull Requests would collapse like this after the line was changed in further commits:
Since the launch of the new feature, line comments no longer collapse even after further commits that address the issues. So far I've only had one PR and I'm not sure if the reviewer added single comments or used the new "Start a review" feature.
How can I get the old behaviour back or does it improve in the new "Start a review" feature?
I've watched their video tutorial on this feature and I can't determine whether the behaviour right now is what I'm supposed to be experiencing.
I sent a message to GitHub support and received the following response:
Sorry for the trouble! We are aware that with reviews comments no longer become "outdated" after new code is pushed.
This is definitely on our radar as something we need to address. I can't give a timeline for it, but we will be looking into it soon.
Since two years ago, GitHub now (august 2018) proposes "Collapse all diffs in a pull request at once":
When a pull request contains a lot of changed files, code reviewers can find it hard to isolate the changes that are relevant to them.
Now you can collapse (or expand) the contents of all diffs in a pull request by holding down the alt key and clicking on the inverted caret icon in any file header.
You can then go one step further by using the “Jump to file or symbol” dropdown to jump to the file that you’re interested in and automatically expand it.
That is not exactly the old behavior, but that does still improve the code review process.

Is there a way to fold diffs in github pull request file view

I have made 5 modifications. The third modification is adding a very long file which doesn't need close inspection. I'd like to fold file 3 so I can see the small but important diffs of files 1, 2, 4, and 5 without doing tons of scrolling past file 3. I can't find such a button on github's PR page, even though such a thing exists on Phab.
Am I missing it or is it not there?
I sent a feature request. Reply from github:
Indeed, that's not possible currently. I do agree that would be useful, so I'll pass your suggestion to the team working on diffs to consider, but I can't make any promises.
Update: they added the feature
You can check my chrome extension: https://chrome.google.com/webstore/detail/github-code-tree/caffoilocbbhnkdlpdcfanpbeholjdii
It helps me a bit for checking commits or pr's :)

How can a GitHub user view a history of changes to issue comments?

My team and I use checklists in GitHub issue comments, especially in the first comment of an issue. The first comment becomes a summary that evolves over time, but it makes me uncomfortable that I don't know how to see the history of earlier versions of a changed comment.
It's not possible, according to a GitHub representative, on 2015-11-11.

How to view line comments in GitHub?

I spent all morning in GitHub reviewing a pull request, writing detailed comments on many lines in the Diff view on the pull-request page.
I individually saved every line-by-line comment, and they all appeared in their correct places. I left the pull-request page, and when I returned to it, all my line-by-line comments were gone!
I have no idea why they disappeared, where they went, whether other users can see them and I can't, what any of this means, and whether I can trust myself going forward using GitHub, or whether I just have to go back to the telephone and fax for remote collaboration!
I did some web searches such as "how to view line comments in GitHub" for info about this, but could not find anything to relieve my panic. I will be grateful for advice and clues.
This is top result for "Can't view github comments" in google.
If you're here because you've left comments, and can see your own comments, but others cannnot, then check for a yellow pending label on your comments. Others cannot see your comment until you've completed the review process and selected whether you want to request changes. Once you click through a full review, then others will see your comments.
Note: I'm answering a slightly different question than the O.P., but I have a feeling that lots of other devs with this issue are hitting this stackoverflow question. I'm just hoping to help them. I myself had this issue and couldn't find a more relevant answer than this thread. :)
The line-comments depend on the commit that were made on.
If the person that made the pull request rebased that commit then you're not looking at what you were previously looking. It's a different commit, thus there are no comments.
Look on the 'Your Actions' tab and find a line in the actions' history were you commented on that commit, click that commit and you'll see the comments are still there.
If the commit was rebased, you wont find that commit were it used to be (some branch) and not on any repo probably (if it's not on another branch). It is just cached by git and github, until the garbage collector kicks in.
The old answer doesn't work for me because I don't see Your Actions or Public Actions now.
My pending comments disappeared after I started typing into what I thought was a comment I'd opened for editing. It wasn't open, and one of my keys may have been a shortcut. I could still see the button to finish my review (including the count of my pending comments) but the comments had disappeared.
I eventually got them back by navigating to the pull request, then to the commit I was reviewing.