Skip to content

Commit 6271222

Browse files
authored
Merge pull request openSUSE#1964 from dmach/git-obs-pr-create-commit-messages
Add commit messages as commented lines to the template in 'git-obs pr create'
2 parents 0ce49e8 + 67a711c commit 6271222

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

osc/commands_git/pr_create.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@
2222
# Creating {source_owner}/{source_repo}#{source_branch} -> {target_owner}/{target_repo}#{target_branch}
2323
#
2424
{git_status}
25+
#
26+
# Commits:
27+
{git_commits}
2528
""".lstrip()
2629

2730

@@ -137,6 +140,12 @@ def run(self, args):
137140
else:
138141
git_status = "#"
139142

143+
if use_local_git:
144+
git_commits = git._run_git(["log", "--format=- %s", f"{target_branch_obj.commit}..{source_branch_obj.commit}"])
145+
git_commits = "\n".join([f"# {i}" for i in git_commits.splitlines()])
146+
else:
147+
git_commits = "#"
148+
140149
message = gitea_api.edit_message(template=NEW_PULL_REQUEST_TEMPLATE.format(**locals()))
141150

142151
# remove comments

0 commit comments

Comments
 (0)