Multi-Line comments (BB-6759)

Issue #5547 open
Adam Stortz
created an issue

Would like to be able to select multiple lines when commenting on code

Comments (56)

  1. Dylan Etkin

    Hi Adam,

    When we wrote the feature we debated if we should support multi-line selections. Crucible does but we felt that it confuses the UI and did not have a compelling enough usecase.



  2. Zachary Davis

    Currently there is no way to reference multiple lines, other than the line numbers (which I understand is crude, but can be effective). As Dylan mentions, this isn't an oversight so much as a conscious decision, one that we knew had both pros and cons.

  3. Ismail S

    While reviewing, I've an objection about 3 lines of code. Hence I would like to point to those all the 3 lines instead of one line for my comment. Hope that gives you a reason to re-consider?

    Yeah, it isn't stopping the rotation of earth if I can't point to all the 3 lines. But yes, as a Github user I've seen we can do that and it was useful and I hope there are others who feel so.

  4. Daniel Bennett staff

    I would agree. It seems as though won't fix is a bit short-sighted, to be honest. I'm going to re-open it. We may won't fix it again but perhaps we'll have a better argument the second time around.

  5. Guillaume Simard

    Thanks Dan!

    Here are some reasons why I would like to use multi-line comments:

    • You want to comment on pieces of code that make little sense on a single line
      • e.g. a multi-line if condition that could be reworked
    • You want to place a single comment on a large piece of code
      • e.g. Instead of having to type "The code in the functions abc() and xyz() do not follow our coding standards" you can simply comment over the two methods saying "Does not follow coding standards".
    • It helps with precision. Instead of having to describe what your comment applies to, you can directly point to it, using the exact right scope. (Better communication)

    Of course these aren't mind blowing benefits but they're very nice to have. I certainly miss them from Reviewboard :)


  6. Paul van Klaveren

    I also run into this problem on a daily basis.

    In terms of usability, the fact that developers are actually using the line commenting feature as is — seeing the code review comment appear near the code it applies to — already shows that most developers actually prefer to be specific about the context of their comment.

    How many Bitbucket users refrain from using line comments, and instead place their review comments straight underneath the pull-request description? I wonder…

    This feature request is nothing more than an improvement of a feature that has already been proven to be very important to the review process.

  7. D T

    I too would like to add my +1 on this feature request. Is a shame for bitbucket to lag behind gerrit and github in this regard. In fact if you guys could implement it so that the lines don't have to be contiguous you would have an advantage over the other 2 (I think, been a while since I used Gerrit)

  8. Richard Colley

    I would love this too. We use crucible at work, and this feature is invaluable.

    The argument I heard against it was that if you just want to select text so you can copy it, then the comment editor is invoked when you didn't want it. But couldn't comment line selection be done with a modifier key? i.e. shift-click/drag if you want to comment. Without shift, it's just normal selection behaviour.

  9. Morgan Strong

    Having previously used Crucible at another studio, I was surprised that the same functionality wasn't available from Atlassian in BitBucket (used by my new employer). This feature would be highly useful for our code reviews.

  10. DH66

    Multi-line comments are essential. Single line comments are fine for trivial stuff like typos be real coding and logic defects almost always span multiple lines. Highlighting on the UI would be nice but if you really feel such a useful feature confuses the UI at least consider auto-filling the first line of the comment box with "lines: xxx-yyy" when the user marks a multi-line selection.

  11. Jimmy Duchesne

    Same as everyone else here, I would definitely use the multi-line feature every single day. It's especially useful when you get an email with comments. You only see one line in the email. It's confusing.

  12. David Dripps

    I just started using BitBucket. Coming from Phacility/Phabricator, it seems like they just gave up on making this a robust product years ago. This is by far my biggest ask though.

  13. KevinLafayette

    I also am coming from reviewboard; want multi line selection. Also, non-contiguous line selection; sometimes the same issue is repeated a few times, and you don't want to have 3 tasks, for 3 of the same fix.

  14. Gareth Jones

    @KevinLafayette has hit the nail on the head.

    While it might be confusing, it's a pain in the ass when you have a couple of lines that all need the exact same comment, and cause the exact same conversation.

    I had that happen just today in a PR, where I suggested two variables would make good candidates to be refactored into constants. I had to put the exact same comment on two lines, which my colleague had to make the exact same reply on both comments.

    As a compromise in the meantime, just the ability to have a task reference multiple lines would be great.

  15. Jiafan Zhou

    I recently work for a project version controlled in BitBucket and performs code review. Coming from the gerrit, I usually put comment across multiple lines. Not every code is python or functional programming so only 1 line of code covers all functionality. If you have used gerrit, you will notice straight away it is a must have in bitbucket. +1 to add this feature (even a plugin) to have this support.

  16. Jay

    This feature is very much needed. It is confusing to the user when my intention is to comment on a block of code, but I have to highlight a single line. The user then thinks there's a problem with that specific line.

  17. Log in to comment