Problem
When a feature branch has been rebased or contains merge commits from main, git diff main...feature-branch includes all those merged files in the diff. This causes the review to process hundreds of files that are not part of the actual feature change.
Example
MR !340 (feature/runtime-model-fallback) on agents-python:
git diff --stat main...feature/runtime-model-fallback shows 377 files changed, 41,829 insertions
git diff --stat dc8f17b98^..a79d3f913 (feature commits only) shows 9 files changed, 750 insertions
The 377/41k number is merge noise. The review should only see the 9/750.
Suggested Fix
Use git merge-base main feature-branch to find the true fork point, or allow the user to specify a commit range (--from-commit). GitLab MRs expose diff_refs.base_sha which gives the correct base.
Alternatively, detect when the diff is dominated by merge commits and warn the user.
Related
This caused issue #18 -- the inflated diff was what made the review stall.
Problem
When a feature branch has been rebased or contains merge commits from main,
git diff main...feature-branchincludes all those merged files in the diff. This causes the review to process hundreds of files that are not part of the actual feature change.Example
MR !340 (
feature/runtime-model-fallback) on agents-python:git diff --stat main...feature/runtime-model-fallbackshows 377 files changed, 41,829 insertionsgit diff --stat dc8f17b98^..a79d3f913(feature commits only) shows 9 files changed, 750 insertionsThe 377/41k number is merge noise. The review should only see the 9/750.
Suggested Fix
Use
git merge-base main feature-branchto find the true fork point, or allow the user to specify a commit range (--from-commit). GitLab MRs exposediff_refs.base_shawhich gives the correct base.Alternatively, detect when the diff is dominated by merge commits and warn the user.
Related
This caused issue #18 -- the inflated diff was what made the review stall.