Problem
When generating release notes for a maintenance branch (e.g. v2.6.x) that runs in parallel with a development branch (v2.7.x), the current timestamp-based commit fetch (repo.get_commits(since=…)) returns commits from all branches in the time window. This causes unrelated develop-branch PRs to appear in the maintenance patch release notes.
Solution
When from-tag-name is explicitly provided, switch to the GitHub Compare API (repo.compare(from_tag, to_tag)). This returns only commits reachable from tag-name but not from from-tag-name, regardless of timestamps or branches — identical to running:
git log --oneline --right-only --cherry-pick <from-tag>...<to-tag>
PR numbers are extracted from the returned commit messages and fetched individually. The existing timestamp path is unchanged when from-tag-name is not set.
Files affected
release_notes_generator/model/mined_data.py — add compare_commit_shas: set[str]
release_notes_generator/data/miner.py — add compare-mode branch and _extract_pr_numbers_from_commits helper
release_notes_generator/data/filter.py — skip timestamp filter when compare_commit_shas is non-empty
Problem
When generating release notes for a maintenance branch (e.g.
v2.6.x) that runs in parallel with a development branch (v2.7.x), the current timestamp-based commit fetch (repo.get_commits(since=…)) returns commits from all branches in the time window. This causes unrelated develop-branch PRs to appear in the maintenance patch release notes.Solution
When
from-tag-nameis explicitly provided, switch to the GitHub Compare API (repo.compare(from_tag, to_tag)). This returns only commits reachable fromtag-namebut not fromfrom-tag-name, regardless of timestamps or branches — identical to running:PR numbers are extracted from the returned commit messages and fetched individually. The existing timestamp path is unchanged when
from-tag-nameis not set.Files affected
release_notes_generator/model/mined_data.py— addcompare_commit_shas: set[str]release_notes_generator/data/miner.py— add compare-mode branch and_extract_pr_numbers_from_commitshelperrelease_notes_generator/data/filter.py— skip timestamp filter whencompare_commit_shasis non-empty