From 057b32a2f9cc73d507be6e3f5e7c6ca404e37eab Mon Sep 17 00:00:00 2001 From: Jonathan Teran Carballo Date: Sun, 21 Dec 2025 23:10:21 -0300 Subject: [PATCH] feature: usar commit message cuando el pr solo tiene un commit --- src/git_flow/command/merge.py | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/src/git_flow/command/merge.py b/src/git_flow/command/merge.py index 7e5fc84..ff2f17b 100644 --- a/src/git_flow/command/merge.py +++ b/src/git_flow/command/merge.py @@ -80,11 +80,22 @@ class MergeCommand(Command): def create_pull_request(self, token: str, branch: str, target: str): changelog = Changelog() - title = self.prompt("[Opcional] Ingrese un titulo para el PR") - title = title or branch.replace("/", ": ").replace("-", " ") + commits = Git("log", target + "..", format="%s").lines() - if title.startswith("release: "): - title = title[title.index(' ', title.index(' ') + 1) + 1:] + if len(commits) == 1: + title = commits[0] + else: + title = branch.replace("/", ": ").replace("-", " ") + + if title.startswith("release: "): + title = title[title.index(' ', title.index(' ') + 1) + 1:] + + self.info("Título del PR por defecto: " + title) + + opt_title = self.prompt("[Opcional] Ingrese otro titulo para el PR") + + if opt_title: + title = opt_title message = self.get_remote_api(token).create_pull_request( branch,