30

I'm reviewing a Github pull request for some new code. As can be seen in the partial screenshot below, some of the files being submitted are binary files that have been intentionally omitted by Github. The message displayed is "Binary file not shown."

enter image description here

I want to comment on the pull request about these files because they are being created in incorrect folders, but Github doesn't appear to have that feature for these files.

Is it possible for me to comment on Github pull requests for binary files not shown? If so, how?

I have tried bumbling around the UI, Googling, searching for this issue on the Github forum and here on SO, but to no avail. Thanks in advance.

entpnerd
  • 10,049
  • 8
  • 47
  • 68
  • 2
    A similar use case I run into frequently is wanting to comment on a change to an image. It's a bit perplexing that there is apparently no mechanism for that at present. – Matt R Jun 18 '21 at 11:17
  • 1
    This should be available (still in beta) now (March 2023). See [my updated answer below](https://stackoverflow.com/a/58242366/6309). – VonC Mar 14 '23 at 22:14
  • 1
    It is now (Apr. 2023) GA (Generally Available). See my [updated answer below](https://stackoverflow.com/a/58242366/6309). – VonC Apr 11 '23 at 22:28

2 Answers2

19

Update April 2023:

Commenting on files in a pull request is now generally available (Apr. 2023)

Commenting on files (including deleted, binary, and renamed files) in a pull request is now generally available on the web and GitHub Mobile! A special thank you to everyone that provided feedback during the public beta.

API support is also now available.
See create a review comment (REST API) or addPullRequestReviewThread (GraphQL mutation) for more details on commenting on files.
A new "subject type" field is also now returned by other APIs indicating whether a comment is on a line or file.

Learn more about commenting on a pull request.

Update March 2023:

Comment on files in a pull request (public beta) (Mar. 2023)

Commenting directly on a file in a pull request (not just a specific line) is now available in public beta!

With this capability you can now comment on deleted, binary (including images), and renamed files in a pull request.
You can also comment generally about a changed code file without having to attach the comment to a specific line.

To comment on any file in a pull request, click the Comment on this file button in the header of the file (next to the Viewed checkbox):

https://i0.wp.com/user-images.githubusercontent.com/2503052/224705215-db5850c9-2f6a-416f-9f01-5800aeb24aac.png?w=919&ssl=1 -- image

Comments on files appear in the Files Changed and Conversation tabs and can be replied to and resolved like regular review comments.

https://i0.wp.com/user-images.githubusercontent.com/2503052/224706418-e60baddc-6edc-41bd-af58-38d9b0aa1b08.png?w=906&ssl=1 -- image

This feature is currently in public beta, with GitHub Mobile and API support coming soon.

Join the discussion and let us know what you think!


2019: First, as illustrated in Reviewable/Reviewable issue 135, this is not possible for GitHub itself (even though it is possible for some third-party tools).

Comments are still evolving (see "Multi-line comments"), but nothing involves binaries.

The main workaround remains to leave a comment on the PR itself, (conversation tab) rather than on a non-supported file.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • 14
    Lets say, as a reviewer I need to suggest removing the binary file from the commit. I cant comment and its a bad design. – Sazzad Hissain Khan Apr 23 '21 at 04:46
  • 1
    @SazzadHissainKhan Agreed. That still seems to be an issue. – VonC Apr 23 '21 at 04:49
  • 1
    2022 and it is still an issue. And not only for binaries, you can't add comment to any file (if you do not want to reference a particular line). It should have been fixed. – Vočko Sep 20 '22 at 06:42
  • @Vočko I agree. So far, no visible evolution on that front. – VonC Sep 20 '22 at 06:43
2

This is on the GitHub Public Roadmap scheduled for Q3 2022 (any day now...):

github/roadmap/issues/Comment on binary and deleted files in a pull request #536

Jim Kring
  • 21
  • 1
  • Would be awesome to see a new answer when this functionality is finally released with an example. IMO, that would be super useful and merit an upvote at that time. – entpnerd Oct 10 '22 at 16:52
  • A fortnight ago it was tagged with `3.8 release in Q1'23` – jezmck Dec 02 '22 at 09:10