"Compare" shows no diff in include-target-changes mode
Summary
When using the Compare Revisions page, enabling “Include changes to target after source was created” produces “There isn't anything to compare”, even though git diff <source>..<target> in a local repo correctly shows differences.
This indicates a mismatch between GitLab’s compare logic and native git diff.
| Compare Revisions Page | git diff command |
|---|---|
|
|
Steps to reproduce
- Create a new branch
test-comparebased onmain. - Make a simple commit on
test-compare(e.g., change a line of text) and push it. - Go to the GitLab Compare page.
- Set Source=
main, Target=test-compare - Enable the checkbox: “Include changes to target after source was created”.
- Click Compare.
- Observe that GitLab displays: “There isn't anything to compare”
- Run the equivalent command locally:
git fetch git diff test-compare..main # Local diff shows actual content changes.
Example Project
test-mirror-ui/project1@test-compare..main
What is the current bug behavior?
The Compare page shows no diff (“There isn't anything to compare”) even though the two branches have differences.
Swapping the Source/Target order sometimes makes the diff appear, which suggests the data is correct but the internal logic or rendering path is incorrect.
Local git diff consistently shows the expected diff.
What is the expected correct behavior?
With “Include changes to target after source was created” enabled, GitLab should behave like:
git diff <source> <target>
# or equivalently
git diff <source>..<target>
and display all differences between the two branch tips, regardless of direction.
Relevant logs and/or screenshots
The screenshot is provided above.

