MCPcopy Create free account
hub / github.com/commitizen-tools/commitizen / tag

Function tag

commitizen/git.py:167–177  ·  view source on GitHub ↗
(
    tag: str, annotated: bool = False, signed: bool = False, msg: str | None = None
)

Source from the content-addressed store, hash-verified

165
166
167def tag(
168 tag: str, annotated: bool = False, signed: bool = False, msg: str | None = None
169) -> cmd.Command:
170 if not annotated and not signed:
171 return cmd.run(["git", "tag", tag])
172
173 # according to https://git-scm.com/book/en/v2/Git-Basics-Tagging,
174 # we're not able to create lightweight tag with message.
175 # by adding message, we make it a annotated tags
176 option = "-s" if signed else "-a" # The else case is for annotated tags
177 return cmd.run(["git", "tag", option, tag, "-m", msg or tag])
178
179
180def add(*args: str) -> cmd.Command:

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected