Add file and line number to mr view --comments command

Problem to solve

As a user, I want to see on which file in my merge request a comment has been made when using the mr view --comments command, so I can jump right back into resolving the comment without needing to open the Web UI.

Proposal

Change the current format of mr view --comments values from <Author> commented <when> to <Author> commented <when> on <file>:<line> where it's possible. To improve this even more, it could be possible to include the diff snippet just like in the Web UI for the best experience.

Further details

The main reason for this is that when I have submitted a merge request, there might be some small comments like "Left over debug statement" or "Let's move this to a constant". These kind of comments don't really require me to switch to the Web UI to have a conversation about them, I just go ahead and fix them.

The current situation of it looks something like:

  • I run mr view --comment and see some small comments
  • I have to open the Web UI to see where the comment was made
  • Switch back to my editor and fix them

If I can see the data about where the comments were made right in the CLI, I can simply just skip step 2. Otherwise, a comment like "Remove this print line" is very useless in a CLI output.

The best would be if the Web UI with the diff around the comment could be seen too, but I have not looked into how much effort that would be.

I have made the change for myself locally, and I can make an MR if the change sounds reasonable.

Links / references

My own change to add the file:number Somewhat related, just more broad: #7907