feature: agrego opcion para listar ramas wip

This commit is contained in:
Jonathan Teran Carballo
2025-12-14 21:56:18 -03:00
parent 74c333aa1a
commit 774cf9ade6
3 changed files with 26 additions and 15 deletions
+5 -5
View File
@@ -1,6 +1,6 @@
from argparse import Namespace
from datetime import datetime
from git_flow import COMMIT_TYPES, GitFlowError
from git_flow import COMMIT_TYPES, TRASH_BRANCH_PREFIX, WIP_BRANCH_PREFIX, GitFlowError
from git_flow.command.base import Command
from git_flow.git import Git
@@ -31,8 +31,8 @@ class CommitCommand(Command):
)
message = commit_type + ": " + commit_message
if branch.startswith("wip/"):
original_branch = branch.removeprefix("wip/")
if branch.startswith(WIP_BRANCH_PREFIX):
original_branch = branch.removeprefix(WIP_BRANCH_PREFIX)
Git("commit", m=message).exec(print="Creando commit en rama WIP")
if commit_type != "wip":
@@ -40,10 +40,10 @@ class CommitCommand(Command):
Git("switch", original_branch).exec(print="Volviendo a rama original")
Git("merge", branch, squash=True).exec(print="Squasheando commits WIP en uno solo")
Git("commit", m=message).exec(print="Creando commit final de rama WIP")
Git("branch", branch, "trash/" + branch + "/" + suffix, move=True).exec(print="Backup de rama WIP")
Git("branch", branch, TRASH_BRANCH_PREFIX + branch + "/" + suffix, move=True).exec(print="Backup de rama WIP")
else:
if commit_type == "wip":
Git("switch", "wip/" + branch, create=True).exec(print="Creando nueva rama WIP")
Git("switch", WIP_BRANCH_PREFIX + branch, create=True).exec(print="Creando nueva rama WIP")
Git("commit", m=message).exec(print="Creando commit")