Skip to content

Commit e2a5ed1

Browse files
LuisHenriLee-W
authored andcommitted
feat: add custom message to annotated git tag
1 parent d18b261 commit e2a5ed1

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

commitizen/git.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,13 +82,14 @@ def from_line(cls, line: str, inner_delimiter: str) -> GitTag:
8282
return cls(name=name, rev=obj, date=date)
8383

8484

85-
def tag(tag: str, annotated: bool = False, signed: bool = False) -> cmd.Command:
85+
def tag(tag: str, annotated: bool = False, signed: bool = False, msg: Optional[str] = None) -> cmd.Command:
8686
_opt = ""
8787
if annotated:
8888
_opt = f"-a {tag} -m"
8989
if signed:
9090
_opt = f"-s {tag} -m"
91-
c = cmd.run(f"git tag {_opt} {tag}")
91+
92+
c = cmd.run(f"git tag {_opt} {tag if _opt == '' or msg is None else msg}")
9293
return c
9394

9495

0 commit comments

Comments
 (0)