Skip to content

Review comments shown on the wrong line in commit view

Summary

When reviewing changes, I review and comment on each commit separately. Lately when I make comments on a commit, the comment is showing up in the wrong location in the commit view.

Viewing comments in the Changes view (all commits) is correct: Screenshot_from_2018-09-07_10-36-15

Viewing those same comments in the Commit view is incorrect: Screenshot_from_2018-09-07_10-47-08

It seems like the comments are attached to the line number in the final version, and not associated with the line numbers in intermediary commits.

Steps to reproduce

  • Post a merge request with multiple commits
  • Make a comment in patch 1 on a line number X that changes to line number Y in a later patch

Example Project

https://gitlab.freedesktop.org/drm-hwcomposer/drm-hwcomposer/merge_requests/25/diffs#4d1c6bf90c02120460f905efd45a1464fd7e88aa

vs.

https://gitlab.freedesktop.org/drm-hwcomposer/drm-hwcomposer/merge_requests/25/diffs?commit_id=86d813f991130ad50915e43f2b61715b2524406e#4d1c6bf90c02120460f905efd45a1464fd7e88aa

What is the current bug behavior?

  • The commit view of patch 1 will show the comment on line Y instead of line X

What is the expected correct behavior?

  • The commit view of patch 1 shows the comment on line X
  • The total change view shows the comment on line Y

Relevant logs and/or screenshots

Above

Output of checks

N/A

Results of GitLab environment info

I don't have access to this info.

Results of GitLab application Check

I don't have access to this info.

Possible fixes

(If you can, link to the line of code that might be responsible for the problem)