Reverse commit order and force push
All checks were successful
Run Python tests (through Pytest) / Test (push) Successful in 24s
Verify Python project can be installed, loaded and have version checked / Test (push) Successful in 22s

This commit is contained in:
Jon Michael Aanes 2025-04-15 00:42:09 +02:00
parent d25dae34f0
commit 5867cf299f

View File

@ -174,7 +174,7 @@ def create_aider_command(issue: str) -> list[str]:
return l
def get_commit_messages(cwd: Path, base_branch: str, current_branch: str) -> str:
def get_commit_messages(cwd: Path, base_branch: str, current_branch: str) -> list[str]:
"""Get commit messages between base branch and current branch.
Args:
@ -193,7 +193,7 @@ def get_commit_messages(cwd: Path, base_branch: str, current_branch: str) -> str
capture_output=True,
text=True,
)
return result.stdout.strip()
return reversed(result.stdout.strip().split('\n'))
except subprocess.CalledProcessError:
logger.exception(f'Failed to get commit messages on branch {current_branch}')
return ''
@ -220,11 +220,11 @@ def push_changes(
if commit_messages:
description += '## Commit Messages\n\n'
for message in commit_messages.split('\n'):
for message in commit_messages:
description += f'- {message}\n'
# First push the branch without creating a PR
cmd = ['git', 'push', 'origin', branch_name]
cmd = ['git', 'push', 'origin', branch_name, '--force']
run_cmd(cmd, cwd)
# Then create the PR with the aider label