diff --git a/.idea/encodings.xml b/.idea/encodings.xml new file mode 100644 index 0000000..15a15b2 --- /dev/null +++ b/.idea/encodings.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/tool/services/github_service.py b/tool/services/github_service.py index 387e1bb..2cf0a76 100644 --- a/tool/services/github_service.py +++ b/tool/services/github_service.py @@ -104,7 +104,8 @@ def create_pull_request(self, target_remote, target_branch, current_branch): git_push() - title, body = prompt_for_pr_content(get_commit_msgs(base)) + pre_title = current_branch.replace("-", " ") + title, body = prompt_for_pr_content(get_commit_msgs(base), title=pre_title) opts = { "title": title, diff --git a/tool/utils.py b/tool/utils.py index df32b96..0ca8259 100644 --- a/tool/utils.py +++ b/tool/utils.py @@ -73,10 +73,11 @@ def get_remote_url(remote): return remote, url.decode("utf-8").strip() -def prompt_for_pr_content(commit_msgs): +def prompt_for_pr_content(commit_msgs, title=None): t = tempfile.NamedTemporaryFile(delete=False, prefix='gh.') try: - template = "Title of this PR\n\nPR body:\n{}".format(commit_msgs) + title = title or "Title of this PR" + template = f"{title}\n\n{commit_msgs}\n\n" template_b = template.encode("utf-8") t.write(template_b) t.flush()