Inline "Compare changes" toggle in MR discussion doesn’t reveal diff
Summary
After changing a commit message via git commit --amend and then making a separate new commit with the actual code changes, the inline "Compare changes" arrow in the MR discussion toggles but never expands the diff snippet.
Steps to reproduce
- Create or open a Merge Request on GitLab (with a few commits).
- Reviewer leaves an inline comment on line N of an example file.
- Locally:
# 1) Amend previous commit message only
git commit --amend -m "New commit message"
# 2) Make the reviewer’s suggested code change (and any other tweaks)
# then stage them
git add example.rb
# 3) Create a fresh commit for the code change
git commit -m "Apply reviewer feedback on example.rb"
# 4) Force-push to update the history
git push --force
-
Reload the MR discussion. Under the reviewer’s comment you see
YourName changed this line in version 2 of the diff one hour ago and a small down-arrow labeled "Compare changes".
-
Click that arrow: it toggles up/down, but no diff pane opens inline.
-
(As a workaround) Clicking the "version 2" link takes you to the full "Changes" tab, where you can see it.
Example Project
What is the current bug behavior?
The arrow icon toggles but no snippet ever appears.
What is the expected correct behavior?
Clicking "Compare changes" next to an inline comment should expand a little diff snippet showing exactly what changed on that line between versions 1 and 2.
Relevant logs and/or screenshots
Screen_Recording_2025-05-14_at_10.43.05
Output of checks
This bug happens on GitLab.com
Results of GitLab environment info
Expand for output related to GitLab environment info
(For installations with omnibus-gitlab package run and paste the output of: `sudo gitlab-rake gitlab:env:info`) (For installations from source run and paste the output of: `sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production`)
Results of GitLab application Check
Expand for output related to the GitLab application check
(For installations with omnibus-gitlab package run and paste the output of:
sudo gitlab-rake gitlab:check SANITIZE=true)(For installations from source run and paste the output of:
sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production SANITIZE=true)(we will only investigate if the tests are passing)