Include commit messages in the pull request body #66

Merged
Jmaa merged 2 commits from jmaa/issue-38-include-commit-messages-in-the-pull-request-body into main 2025-04-14 21:57:19 +00:00
2 changed files with 8 additions and 8 deletions
Showing only changes of commit 3bdbf2e621 - Show all commits

View File

@ -138,6 +138,7 @@ For code tasks:
MODEL = None
def create_aider_command(issue: str) -> list[str]:
l = [
'aider',
@ -195,7 +196,7 @@ def get_commit_messages(cwd: Path, base_branch: str, current_branch: str) -> str
return result.stdout.strip()
except subprocess.CalledProcessError:
logger.exception(f'Failed to get commit messages on branch {current_branch}')
return ""
return ''
def push_changes(
@ -209,16 +210,16 @@ def push_changes(
if not has_commits_on_branch(cwd, base_branch, branch_name):
logger.info('No commits made on branch %s, skipping push', branch_name)
return False
# Get commit messages for PR description
commit_messages = get_commit_messages(cwd, base_branch, branch_name)
description = f"This pull request resolves #{issue_number}\n\n"
description = f'This pull request resolves #{issue_number}\n\n'
if commit_messages:
description += "## Commit Messages\n\n"
description += '## Commit Messages\n\n'
for message in commit_messages.split('\n'):
description += f"- {message}\n"
description += f'- {message}\n'
cmd = [
'git',
'push',

View File

@ -1,4 +1,3 @@
from aider_gitea.seen_issues_db import SeenIssuesDB