diff --git a/src/git_flow/command/release.py b/src/git_flow/command/release.py index 2605441..8a9a1d2 100644 --- a/src/git_flow/command/release.py +++ b/src/git_flow/command/release.py @@ -43,6 +43,17 @@ class ReleaseCommand(Command): else f"release/{next_env}/{branch}" ) + base = Git.get_first_fork_point(branch, env) + commits = Git("log", base + ".." , format="%s").lines() + + if not commits: + raise GitFlowError("No hay cambios a mergear.") + + print("Cambios a pasar al proximo entorno:") + + for commit in commits: + print("- " + commit) + group = args.group if not group and self.confirm("¿Desea agrupar este release con otra rama?", False): @@ -55,11 +66,8 @@ class ReleaseCommand(Command): Git("pull").exec(print="Sincronizando cambios la rama objetivo") Git("switch", "-").exec(print="Volviendo a la rama original") - base = Git.get_first_fork_point(branch, env) - commits = int(Git("rev-list", base + "..", count=True).firstline()) - - if commits > 1 and self.confirm( - f"¿Desea reemplazar los {commits} commits de la rama por uno solo?", + if len(commits) > 1 and self.confirm( + f"¿Desea reemplazar los {len(commits)} commits de la rama por uno solo?", False ): self.info("Debe ingresar el mensaje del commit a crear.")