Create and list tag objects running git-tag command

def tag(self, name=None):
        """Create and list tag objects running git-tag command"""

        command = ["git", "tag"]

        if not name:
            command.extend(
                [
                    "-l",
                    "--sort=creatordate",
                    "--format=%(creatordate:short)%09%(refname:strip=2)",
                ]
            )

            command_output = _run_command(command).strip()

            if command_output == "":
                return []

            tag_text_list = command_output.split("\n")
            tag_list = [Tag(text) for text in tag_text_list]

            return list(reversed(tag_list))

        command.extend(["-a", name, "-m", '""'])
        return _run_command(command)