checkupdates: make iter_commits only include commits in appid branch

iter_commits() follows `git rev-list` (which selects different commits
than `git diff`).  With ... notation, `git rev-list` will return all
the commits that are not shared by the two branches.  This needs only
the commits in the right side of the comparison (like how `git diff`
does it).
This commit is contained in:
Hans-Christoph Steiner 2024-10-30 23:29:53 +01:00
parent f34a132132
commit 17c480d299

View file

@ -712,8 +712,9 @@ def push_commits(remote_name='origin', branch_name='checkupdates', verbose=False
git_repo, default = get_git_repo_and_main_branch()
files = set()
upstream_main = default if default in git_repo.remotes.upstream.refs else 'main'
local_main = default if default in git_repo.refs else 'main'
for commit in git_repo.iter_commits(f'upstream/{upstream_main}...{local_main}'):
for commit in git_repo.iter_commits(
f'upstream/{upstream_main}...HEAD', right_only=True
):
files.update(commit.stats.files.keys())
files = list(files)